Skip to content
Clairos Learn

Files and paths · Lesson 30 of 36 · 8 minutes

Canonical path review

Turn relative and linked paths into stable absolute locations.

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

Resolving canonical filesystem paths helps operators explain what they know before they change anything.

realpath
Resolve a path to its canonical location in the virtual filesystem.

Resolving a path and reading its contents are separate operations.

pwd
Print the directory that relative paths currently resolve from.

A relative path is interpreted from the working directory, not necessarily the home folder.

Worked example and expected result
$ realpath README.txt
/home/learner/README.txt

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

$ realpath /etc/nginx/sites-enabled/learn.conf
/etc/nginx/sites-enabled/learn.conf

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

$ pwd
/home/learner

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 “Canonical path review”, which interpretation is safe?

Apply it elsewhere

Before adapting the realpath workflow from “Canonical path review” to another server, what should you do?

Keep the momentum.

Complete the lab, then explain and apply the pattern.

Next: Temporary workspacesTry 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. 01File type inspectionIdentify files, directories, links, and text before acting on them.Practice
  2. 02Temporary workspacesCreate bounded temporary files and directories for disposable work.Practice
  3. 03Sorted inventory comparisonCompare two sorted account inventories without modifying either file.Practice