Default Shell Environment

As mentioned previously, when you log in and get a shell, a number of things happen: Certain files are read, some variables are set, and perhaps even a program or two are run. Most of what happens sets up your default environment. This environment is set via the previously mentioned files. A few, however, such as $HOME (a notation indicating a user's home directory—under bash, this can also be abbreviated as a tilde [~])—and $SHELL (which is the shell login called) are obtained from /etc/passwd, as is the UID.

Variables

Listing 14.1 shows a sample /etc/profile. As you can see, one of the first things set is PATH. Custom dictates that environment variables are always uppercase. You can always see how a particular ...

Get Special Edition Using Linux®, Sixth Edition 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.