nerdexam
CompTIA

LX0-103 · Question #46

Which variable defines the directories in which a Bash shell searches for executable commands?

The correct answer is C. PATH. The PATH environment variable lists colon-separated directories the shell searches when resolving executable command names.

GNU and Unix Commands

Question

Which variable defines the directories in which a Bash shell searches for executable commands?

Options

  • ABASHEXEC
  • BBASHRC
  • CPATH
  • DEXECPATH
  • EPATHRC

How the community answered

(22 responses)
  • B
    9% (2)
  • C
    86% (19)
  • E
    5% (1)

Why each option

The PATH environment variable lists colon-separated directories the shell searches when resolving executable command names.

ABASHEXEC

BASHEXEC is not a defined Bash or POSIX variable and has no effect on command lookup.

BBASHRC

BASHRC is the name of a configuration file (~/.bashrc) sourced for interactive shells, not a variable controlling executable search paths.

CPATHCorrect

PATH is a standard POSIX environment variable that contains an ordered, colon-delimited list of directories. When a command is entered without an absolute path, the shell searches each directory in PATH from left to right until the executable is found or all directories are exhausted.

DEXECPATH

EXECPATH is not a recognized Bash or POSIX variable; it does not exist in the shell environment.

EPATHRC

PATHRC is not a defined variable in Bash or POSIX; it has no role in command resolution.

Concept tested: PATH environment variable and command lookup

Source: https://www.gnu.org/software/bash/manual/bash.html#Command-Search-and-Execution

Topics

#PATH#environment variables#bash#executable search

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice