nerdexam
LPI

010-150 · Question #83

Which command shows if /usr/bin is in the current shell search path?

The correct answer is B. echo $PATH. In POSIX shells, environment variables are referenced with a $ prefix, so echo $PATH prints the value of the PATH variable which contains the shell's search directories.

The Power of the Command Line

Question

Which command shows if /usr/bin is in the current shell search path?

Options

  • Acat PATH
  • Becho $PATH
  • Cecho %PATH
  • Dcat $PATH
  • Eecho %PATH%

How the community answered

(30 responses)
  • A
    3% (1)
  • B
    70% (21)
  • C
    3% (1)
  • D
    17% (5)
  • E
    7% (2)

Why each option

In POSIX shells, environment variables are referenced with a $ prefix, so echo $PATH prints the value of the PATH variable which contains the shell's search directories.

Acat PATH

cat PATH treats 'PATH' as a filename and attempts to read a file named PATH in the current directory, not the environment variable.

Becho $PATHCorrect

The PATH environment variable stores a colon-separated list of directories the shell searches for executables. Using echo $PATH causes the shell to expand $PATH to its value and print it, allowing you to see whether /usr/bin is included in the search path.

Cecho %PATH

The %PATH syntax is the Windows Command Prompt convention for environment variables and is not valid in POSIX/bash shells.

Dcat $PATH

cat $PATH attempts to use the value of PATH as a filename to read, which would fail since PATH contains directory paths separated by colons, not a single file.

Eecho %PATH%

The %PATH% syntax is the Windows Command Prompt convention and is not valid in POSIX/bash shells.

Concept tested: Displaying shell environment variable PATH value

Source: https://www.gnu.org/software/bash/manual/bash.html#index-PATH

Topics

#PATH variable#environment variables#echo command#shell

Community Discussion

7
Viktor S.Viktor S.Mar 19, 2026

B is the correct answer. In a Unix shell, PATH is an environment variable, and you read environment variables with a leading dollar sign. echo $PATH tells the shell to expand that variable and print its value, so you see a colon-separated list of directories like /usr/local/bin:/usr/bin:/bin, and you just scan it to confirm /usr/bin is there. The other options fail for obvious reasons: cat reads files, not variables, so cat PATH tries to open a file literally named PATH and cat $PATH tries to open a file whose name matches the value of PATH, neither of which makes sense here. The percent-sign syntax is Windows CMD, not Unix, so C and E are wrong the moment you remember what OS the 010-150 exam is about.

25
Yusuf A.Yusuf A.Mar 26, 2026

Got this one on my actual exam last month and almost second-guessed myself because I kept mixing up the Windows percent signs from my old desktop support days. My senior had drilled it into me the week before, he literally walked me to a terminal and said "echo dollar sign PATH, that is it, commit that to muscle memory," and it saved me right there in the testing center.

2
Viktor S.Viktor S.Mar 29, 2026

Muscle memory is fine but the real win is knowing why it works, because the moment the exam throws env or printenv at you for the same job, you won't freeze up wondering if you memorized the wrong thing.

0
Ingrid P.Ingrid P.Mar 12, 2026

I actually glanced at A first because "cat PATH" feels plausible if you half-remember that PATH is a file somewhere, but PATH is a shell variable, not a file, so cat on a bare word like that just throws an error. C and E are Windows cmd and batch syntax respectively, which rules them out on any Linux exam item. D is interesting because $PATH does expand the variable, but cat expects a file argument and $PATH expands to something like /usr/local/bin:/usr/bin:/bin, which is not a path to any file, so that fails too. echo $PATH is the right call because echo just prints its arguments to stdout, the shell expands $PATH before echo even sees it, and you get the colon-separated list right there to scan for /usr/bin.

1
Yusuf A.Yusuf A.Mar 14, 2026

One thing I would add is that printenv PATH also works and my senior actually prefers it over echo $PATH because it skips the shell expansion step entirely, so you are reading the variable directly from the environment rather than relying on the shell to expand it first.

0
Ola B.Ola B.Mar 17, 2026

echo $PATH prints the shell's PATH variable, showing every directory searched.

1
Ingrid P.Ingrid P.Mar 20, 2026

That is accurate, though the more important card to make is the one that captures when PATH lookup does NOT happen, meaning commands with a slash in them bypass PATH entirely and the shell invokes the file directly.

0
Full 010-150 Practice