Systems CourseC/C++ · Linux · Memory
LinuxLesson 28 of 441 min read6 questions

Filesystem & Navigation

One tree from /, absolute vs relative paths.

Test yourself ↓

Concept core idea Watch out easy to get wrong

Concept

Key concepts

  1. Single tree rooted at /; no drive letters. Absolute path starts at /; relative path starts from the current directory. . = here, .. = parent.
  2. Relative paths in code (open("config.txt")) resolve against the process's working directory — a common 'file not found' bug.
  3. Commands: pwd (where am I), ls -la (list, long, all), cd .. (up one).
Watch out

Easily confused

absolute vs relative path
Absolute starts at / (same everywhere). Relative starts from the current working directory (depends where you run it).
. vs ..
. = the current directory. .. = the parent directory.

Test yourself

6 questions on this lesson. Write your answers from memory, then compare them with the model answers side by side.