Environment Variables
printenv - check current env variables.
printenv USER
- get a specific env var.
Env vars can be used in script files like: $USER.
We can create user-specific env vars in ./bashrc file in user home directory.
To apply changes we should restart terminal. Or we can run:
source ~/.bashrc
- load new env vars into the current shell session.
System-level env variables should be stored in /etc/environment
.
PATH Environment Variable
List of directories to executable files, separated by
:
.Tells the shell which directories to search for the executable in response to our executed command.
Last updated
Was this helpful?