11THE ENVIRONMENT

image

As we discussed earlier, the shell maintains a body of information during our shell session called the environment. Programs use the data stored in the environment to determine facts about the system’s configuration. While most programs use configuration files to store

program settings, some programs also look for values stored in the environment to adjust their behavior. Knowing this, we can use the environment to customize our shell experience.

In this chapter, we will work with the following commands:

printenv Print part or all of the environment

set Set shell options

export Export environment to subsequently executed programs ...

Get The Linux Command Line, 2nd 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.