O'Reilly logo

Mastering Bash by Giorgio Zarrelli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required