Skip to content
Clairos Learn

Terminal basics · Lesson 31 of 34 · 8 minutes

Absolute and relative path report

Resolve relative names into full canonical paths.

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

Relating the current directory to canonical paths helps operators explain what they know before they change anything.

pwd
Print the directory that relative paths currently resolve from.

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

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

Resolving a path and reading its contents are separate operations.

Worked example and expected result
$ pwd
/home/learner

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

$ realpath README.txt
/home/learner/README.txt

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

$ realpath lab
/home/learner/lab

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 “Absolute and relative path report”, which interpretation is safe?

Apply it elsewhere

Before adapting the realpath workflow from “Absolute and relative path report” to another server, what should you do?

Keep the momentum.

Complete the lab, then explain and apply the pattern.

Next: Help before changeTry 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. 01Output capture contractPrint a predictable marker, capture it, and read it back.Practice
  2. 02Help before changeBuild the habit of reading command guidance and current metadata first.Practice
  3. 03Terminal recovery sequenceReorient, review recent work, and clear the display without losing state.Practice