1.3 Environment Variables Flashcards
How do you preserve the current value of the PATH environment variable when adding a new value to it?
To preserve the current value of the PATH environment variable when appending paths to it, put $PATH. For example, PATH=$PATH:/additional/path.
What are the two different types of variables?
The two different types of varables are user-defined variables and environment variables.
What is a user-defined variable?
Variables assigned with a name and contents of your choice. Does not change the shell environment or how the shell works.
What is an environment variable?
An environment variable is a setting that the operating system or programs working in the operating system access. Environment variables make up the user environment.
What is the standard for environment variable names?
The standard for writing variables names (called variable identifiers) is to use all upper-case letters (e.g., SHELL and EUID).
What do environment variables become when you change them from the defaults?
Changing environmental variables from the defaults result in user-defined variables.
What is a user-defined variable?
A user-defined variable is a variable that applies only to the current session.
How do you make a user-defined environement variable apply to child sessions?
Exporting user-defined variables makes them apply to child sessions.
How do you make user-defined environment variables persistent?
Add user-defined variables to the shell configuration files to make them persistent.
What does the BASH environment variable contain?
The BASH environment variable contains the location of the bash executable file.
What does the SHELL environment variable contain?
The SHELL environment variable contains the user’s login shell.
What does the CPU environment variable contain?
The CPU environment variable contains the type of CPU.
What does the DISPLAY environment variable contain?
The DISPLAY environment variable contains the location where X Windows output goes. Can be used to send X-windows output to another machine.
What does the ENV environment variable contain?
The ENV environment variable contains the location of the configuration file for the current shell.
What does the EUID environment variable contain?
The EUID environment variable contains the ID number of the current user.
What does the HISTFILE environment variable contain?
The HISTFILE environment variable contains the filename where past commands are stored. For Bash, it’s usually ~/.bash_history.
What does the HISTSIZE environment variable contain?
The HISTSIZE environment variable contains the number of past commands that HISTFILE stores for the current session.
What does the HISTFILESIZE environment variable contain?
The HISTFILESIZE environment variable contains the number of past commands that HISTFILE stores for the multiple sessions.
What does the HOME environment variable contain?
The HOME environment variable contains the absolute path of the user’s home directory.
What does the HOST environment variable contain?
The HOST environment variable contains the name of the computer.
What does the HOSTNAME environment variable contain?
The HOSTNAME environment variable contains the name of the computer. It is identical to HOST, but used on certain distributions.
What does the INFODIR environment variable contain?
The INFODIR environment variable contains the path to the computer’s information pages.
What does the LOGNAME environment variable contain?
The LOGNAME environment variable contains the user name of the current user.
What does the MAIL environment variable contain?
The MAIL environment variable contains the path to the current user’s mailbox file. Usually /var/spool/mail/username.