env command stands for “environment,” and returns a list of the environment variables for the current user.
What happens when you type the
env command returns a number of variables, including
HOME. To select the value of a particular environment variable, let’s say
PATH, you can use the following command:
env | grep PATH
the command above displays the value of the
PATH environment variable. Here the standard output of
env is “piped” to the
grep searches for the value of the variable
PATH and outputs it to the terminal. Note that this is the same output as
In the command line type:
You should see a list of variables and their values.
Then specifically display the value of the
PS1 environment variable using
grep, and redirection.
The output should match what the command prompt looks like right now!