From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Modify the shell environment

Modify the shell environment - Linux Tutorial

From the course: Cert Prep: LPIC-1 Exam 101 (Version 5.0)

Start my 1-month free trial

Modify the shell environment

- [Instructor] There are two types of variables accessible in a shell session. Environmental variables are variables that are defined for the current shell and are inherited by any child processes or child shells. Shell variables are variables that are contained exclusively within the shell in which they were defined. They are often used to keep track of data, like the current working directory. To see the environmental variables, in a terminal, type in printenv and hit ENTER. If you want to get the value of an individual variable, you can specify it. Type in printenv and, for instance, type in SHELL and hit ENTER. Another way is to use the echo command to print the value by typing in echo $SHELL, and hit ENTER. To see the shell variables, we use the set command. Type in set and hit ENTER. By default, the set command shows shell functions as well as variables, which can be quite long. To change the behaviors set to POSIX…

Contents