Here are some important environment variables commonly used in Linux:
-
HOME: The path to the current user's home directory.- Example:
/home/username
- Example:
-
USER: The name of the currently logged-in user.- Example:
username
- Example:
-
SHELL: The path to the current user's shell.- Example:
/bin/bashor/bin/zsh
- Example:
-
PWD: The current working directory.- Example:
/home/username/projects
- Example:
-
LANG: The current language and locale settings.- Example:
en_US.UTF-8
- Example:
-
EDITOR: The default text editor for command-line applications.- Example:
nanoorvim
- Example:
-
PATH: As mentioned earlier, it specifies the directories the shell searches for executable files. -
TERM: The type of terminal to emulate when running the shell.- Example:
xterm-256color
- Example:
These variables help configure the environment for users and applications. You can view them using the printenv command or env command in the terminal.
