Skip to main content

Environment Variables

Environment variables store system and user information used by the shell. They define settings like user name, home directory, and paths.

CommandDescription
printenvShow all environment variables
echo $USERDisplay the current user
echo $HOMEShow the home directory path
export VAR=valueCreate or change a variable

Example:

export EDITOR=nano
echo $EDITOR

Output:

nano