Challenge - 5 Problems
Command Locator Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:00remaining
Output of which command
What is the output of the command
which ls on a typical Linux system?Linux CLI
which ls
Attempts:
2 left
💡 Hint
The
which command shows the full path of the executable that runs when you type a command.✗ Incorrect
The
which command searches your PATH and shows the location of the executable. Usually, ls is in /bin.💻 Command Output
intermediate1:00remaining
Output of whereis command
What does the command
whereis python3 typically output?Linux CLI
whereis python3
Attempts:
2 left
💡 Hint
The
whereis command shows locations of the binary, source, and manual files.✗ Incorrect
The
whereis command searches standard locations for binaries, source code, and man pages related to the command.🧠 Conceptual
advanced1:30remaining
Difference between which and whereis
Which statement correctly describes the difference between
which and whereis commands?Attempts:
2 left
💡 Hint
Think about what each command searches for and where.
✗ Incorrect
which finds the executable in your PATH. whereis looks for binaries, source files, and manual pages in standard system locations.🔧 Debug
advanced1:30remaining
Why does which fail to find a command?
You run
which myscript but get no output, even though myscript runs fine when you type it. Why?Attempts:
2 left
💡 Hint
Think about what
which can find and what it cannot.✗ Incorrect
which only finds executables in PATH. It does not find shell aliases or functions, which can run but are not files.🚀 Application
expert2:00remaining
Using which and whereis in a script
You want a script to check if the
git command is installed and print its path. Which snippet correctly does this?Attempts:
2 left
💡 Hint
Think about how to check command success and suppress output.
✗ Incorrect
Option A correctly uses
which git and checks its exit status, suppressing output. This is the best way to test if git is installed.