Environment variables
So far we have only talked about variables that are local to a script. There are also system wide environment variables (env vars) which play a very important part of any Linux system. Here are a few, some of which the reader may already be aware of:
Variable |
Role |
---|---|
|
user's home directory |
|
directories which are searched for commands |
|
command line prompt |
|
hostname of the machine |
|
shell that is being used |
|
user of this session |
|
text editor to use for |
|
number of commands that will be shown by the history command |
|
type of command line terminal that is being used |
Most of these are self-explanatory, however, I will mention a few.
The PS1
environment variable controls what the shell prompt displays as part of the command line. The default setting is usually something like [guest1@big1 ~]$
, which is not as useful as it could be. At a minimum, a good prompt shows...