Mission 43

Path normalization

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

Files and paths
7 minutes Core Lesson 43 of 360
statcd
Lesson 43 of 360 0/360 lessons 0/17 missions Files and paths · 7 minutes
0%
Continue View profile
Ops lab terminal Training lab
New learnerrank 0XP 0%complete
learner@clairos:/home/learner $ Unix ops lab: type a command, press Enter
Instructions 7 minutes

Click any instruction for the command details, the why, and the common mistake to avoid.

Stat dot path

Run stat ./README.txt.

stat ./README.txt
Stat dot-dot path

Run stat notes/../README.txt.

stat notes/../README.txt
Enter notes

Run cd notes.

cd notes
Lesson support

What to notice while you play.

Objective

Understand how ./ and ../ are resolved.

Hint

Compare stat ./README.txt with stat notes/../README.txt.

Why it matters

Path normalization helps spot traversal mistakes.

Common mistakes
  • Assuming every different-looking path is a different file.
  • Using too many .. segments.
Reference

Commands in this lesson.

cd [path]

Change directories inside the lab filesystem.

stat <path>

Show lab file details.