Skip to content
Clairos Learn

Terminal basics · Lesson 6 of 34 · 6 minutes

Command locations

Use which to understand how shells find commands.

Mastery 0/3Run itExplain itApply it
learner@clairosSimulated Linux lab
learner@clairos:~ $
↑ history · Tab complete · Ctrl+C cancel · Esc, Tab to leaveExit 0

Understand the pattern

Knowing where commands come from helps debug confusing PATH issues.

which
Find the simulated executable path for a command.

A path lookup does not prove that running the command will succeed.

Worked example and expected result
$ which nano
/usr/bin/nano

Exit status: 0. The command completed successfully in the training fixture.

$ which systemctl
/usr/bin/systemctl

Exit status: 0. The command completed successfully in the training fixture.

$ which ufw
/usr/sbin/ufw

Exit status: 0. The command completed successfully in the training fixture.

Try a variation

Repeat this workflow in the sandbox with a different scratch filename. Keep the system fixtures unchanged and compare the observed output with your expectation before moving on.

Explain it

In “Command locations”, which interpretation is safe?

Apply it elsewhere

Before adapting the which workflow from “Command locations” to another server, what should you do?

Keep the momentum.

Complete the lab, then explain and apply the pattern.

Next: Environment variablesTry an incident drill

Anonymous lesson and mastery progress lasts for this session. Sign in to keep synced lesson XP between sessions; mastery stays device-local. No speed bonus, lost lives, or hint penalties.

Keep learning

  1. 01Manual pagesUse simulated manual pages to learn command intent before running tools.Practice
  2. 02Environment variablesInspect a simulated environment without exposing real browser or server secrets.Practice
  3. 03System identityInspect simulated kernel, hostname, and clock output.Practice