Skip to content
Clairos Learn

Files and paths · Lesson 12 of 36 · 7 minutes

Path normalization

Use dot and dot-dot safely without leaving the simulated filesystem.

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

Path normalization helps spot traversal mistakes.

stat
Inspect a file or directory metadata record, including ownership, permissions, and size.

Metadata and file contents answer different questions.

cd
Change the shell working directory; .. selects the parent and ~ identifies your home.

Changing directories changes how later relative paths resolve.

Worked example and expected result
$ stat ./README.txt
Path: /home/learner/README.txt
Type: file
Mode: -rw-r--r--
Owner: learner
Group: learners
Size: 148 bytes

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

$ stat notes/../README.txt
Path: /home/learner/README.txt
Type: file
Mode: -rw-r--r--
Owner: learner
Group: learners
Size: 148 bytes

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

$ cd notes
(no output; exit 0)

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 “Path normalization”, which interpretation is safe?

Apply it elsewhere

Before adapting the stat workflow from “Path normalization” to another server, what should you do?

Keep the momentum.

Complete the lab, then explain and apply the pattern.

Next: Script metadataTry 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. 01Wildcard safetySee why broad delete patterns are blocked in the lab.Practice
  2. 02Script metadataInspect and update simulated script permissions.Practice
  3. 03SSH file layoutInspect common SSH files without making any network connection.Practice