Linux Paths and Directory Navigation
An introduction to Linux path notation and the commands used to navigate and inspect directories.
Understand Paths, Navigate, and Inspect
The filesystem and paths
Linux organizes files and directories in one tree rooted at /. A beginning with / is absolute: it specifies a location from the root. A without a leading slash is relative: it is interpreted from your . The special name . means the ; .. means its parent. Names beginning with a dot, such as .config, are hidden names.
Navigate and inspect
Use pwd to print your current working directory. cd /var/log changes to that directory; cd .. moves up one level, and cd with no returns you to your home directory. Use ls to list directory contents. Use ls -la when you also want hidden entries and details such as file type, permissions, owner, size, and modification time.
A argument can refer to a file or directory. Quote a containing spaces, as in ls "Project Notes", so the shell passes it as one argument rather than treating its words separately.