Environment variables

As we discussed earlier, the shell comes with an environment, which dictates what it can do and what not, so let's just have a look at what these variables are using the env command:

zarrelli:~$ env    ...LANG=en_GB.utf8...DISPLAY=:0.0...USER=zarrelli...DESKTOP_SESSION=xfce...PWD=/home/zarrelli/Documents...HOME=/home/zarrelli...SHELL=/bin/bash...LANGUAGE=en_GB:en...GDMSESSION=xfce...LOGNAME=zarrelli...PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games_=/usr/bin/env  

Some of the variables have been omitted for the sake of clarity; otherwise, the output would have been too long, but still we can see something interesting. We can have a look at the PATH variable content, which influences where the shell will look ...

Get Mastering Bash now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.