Linux CLI 23 ๐ง printenv and export commands
printenv โ is used to display all environment variables
printenv USER โ displays the username
you can also print the variables using echo $variable
echo $USER โ displays the user variable
common environment variables:
HOME โ user's home directory USER โ current username
PATH โ list of directories the system looks for commands PWD โ Present working directory
LANG โ default language setting HOSTNAME โ name of the computer
DISPLAY โ default :0 the first display generated SHELL โ current shell program
set is used to set and unset environment variables but...
if you use it with no arguments prints environment and shell variables and functions
export โ displays all the exported variables
export -p โ displays all exported variables on current shell
export -f functionName โ exports a function
export test="kronos" โ set environment variable temporarily
if you want to permanently set it, then โ echo "export VAR_NAME='value'" ~/.bashrc
and then โ source ~/.bashrc
Stop using slow, ad-bloated tool sites! ๐คฎ
๐ Search “KandZ Tools” on Google to use many professional utilities for free.
KandZ.me is the ultimate minimalist hub for:
โ
Finance (Mortgage, Interest, Inflation)
โ
Tech (Base64, JSON, Dev Suite, IP)
โ
Health (BMI, BMR, TDEE)
โ
Productivity (Timer, Workspace, QR)
โก๏ธ Fast & Private
๐ No data leaves your device
๐ 100% Free
๐ Use it now: https://tools.kandz.me
๐ Bookmark itโyouโll need it later!