A set of dynamic variables that can affect the running processes behavior and access to resources.
Environment variables in determine the behavior and access in the system. Some of the settings are contained within configuration settings and others are determined by user input. The shell keeps track of all the settings in the environment, that builds every time it starts a session with variables, defining system properties.
Shell variables are shown with the set
command:
$ set
BASH=/bin/bash
BASHOPTS=checkwinsize:cmdhist:complete_fullquote:expand_aliases:extglob:extquote:force_fignore:histappend:interactive_comments:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
Common environment variables
PATH – a list of directory paths. When the user types a command without providing the full path, this list is checked to see whether it contains a path that leads to the command.
HOME – dictates where a user's home directory is located in the filesystem.
TERM – specifies the type of computer terminal or terminal emulator being used (e.g. xterm-256color)
SHELL - default shell
PWD - prints current working directory
MAIL – used to indicate where a user's mail is to be found
To show an environment variable use the command echo $<environment-variable>
(e.g. echo $PATH
).