LPI Exam Questions

Which of the following commands will you use?

You work as a Network Administrator for Maverick Inc. The company has a Linux-based network.
You are working on a Linux computer. You want to see the environment variables that are set on
your computer. Which of the following commands will you use?

A.
env

B.
rm

C.
ls

D.
echo $shell

Explanation:

The env command is used to list the environment variables that are set on a Linux computer.
The programs that run on a Linux computer are known as processes. When a user starts a
program, a new process is created. This process runs within what is called an environment. A user
can set parameters in this environment so that the running program can find the desired values.
The following syntax is used to set a parameter to a variable:
VARIABLE=value
This would set a parameter by the name VARIABLE with the value that you provide. Some of the
commonly used environment variables are HOME, PATH, PS1, etc.
Answer option B is incorrect. The rm command is used to delete files from a directory on a Linux

computer.
Answer option C is incorrect. The ls command is used to list files on a Linux computer.
Answer option D is incorrect. The echo $shell command will provide the name of the current shell
that a user is using.