Consider these important facts:
Environment variables are all upper case.
To use their values, precede the name with a
Linux utilizes Bash as the default shell and when a session started it reads commands from
Environment variables are set in the file
📝 Note: The files
.bashrc are hidden. To list hidden files, type
Here is a list of some common environment variables:
$HOME - Path of your home directory
$PATH - List of directories where the system checks for programs to run
$LD_LIBRARY_PATH - List of directories where the system checks for shared libraries to load
$HOSTNAME - The name of the host, e.g.
📝 Note: See the values of all your environment variables by typing
env on your terminal.
Display the value of an environment variable using
Modify the value of environment variables with
export PATH=$PATH:/home/UIDexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/UID/custom_lib_directory
Set a value for environment variables:
This command sets the value of the variable called OMP_NUM_THREADS (an OpenMP parameter) to 12.