Which environment variable contains a list of directories that is searched for commands to execute?

  • Post author:
  • Post category:Blog
  • Post last modified:May 9, 2024
  • Reading time:1 mins read

Which environment variable contains a list of directories that is searched for commands to execute?

  • PS1
  • PS2
  • EXEC
  • PATH
Answers Explanation & Hint:

The environment variable that contains a list of directories that is searched for commands to execute is PATH.

When you enter a command in the terminal, the shell searches for that command in the directories listed in the PATH variable. If the command is found in one of the directories, it can be executed directly by typing its name in the terminal. If the command is not found in any of the directories listed in PATH, you will get a “command not found” error.

For more Questions and Answers:

NDG Linux Essentials 2.21 | Command Line Skills Module 5 | Chapter 05 Exam Answers Full 100%