Navigating the Filesystem
Beginner
Overview
Everything in Linux lives under a single tree that starts at the root, written as /. Your shell always has a 'current working directory' — the folder you are in right now.
pwd prints that directory. ls lists what is inside it, and cd changes into another directory. Paths can be absolute (starting with /) or relative to where you currently are.
Two special names are handy: . means 'the current directory' and .. means 'the parent directory'. ~ is shorthand for your home directory.
Cheatsheet
pwdPrint the current working directoryls -lahList all files with sizes in human-readable formcd /var/logChange to an absolute pathcd ..Go up one directorycd ~Go to your home directorycd -Jump back to the previous directoryTry it
A safe, simulated terminal. Run the suggested commands to see typical output.
simulated terminal
Type a command and press Enter, or click a suggestion below to run it.
Quick quiz
1. Which command shows the directory you are currently in?
2. What does `cd ..` do?