Using Linux Environment Variables
Richard A. Blum, Christine Bresnahan · 2015
This chapter focuses on Linux environment variables, showing where they are, how to use them, and even how to create your own. The Linux system sets several global environment variables when a bash session starts. The system environment variables almost always use all capital letters to differentiate them from normal user environment variables. Local environment variables, as their name implies, can be seen only in the local process in which they are defined. The method used to create a global environment variable is to first create a local variable and then export it to the global environment. When you enter an external command in the shell command line interface (CLI), the shell must search the system to find the program. When you start a bash shell by logging in to the Linux system, by default bash checks several files for commands. These files are called startup files or environment files.