BeginnerLesson 2 of 5 · 1 min read
Filesystem Navigation
Move around the filesystem with `pwd`, `ls`, and `cd`.
Linux organises everything under a single root directory /. Unlike Windows, there are no drive letters; everything branches off /.
Three commands you will use constantly
| Command | What it does | Example |
|---|---|---|
pwd | Print current directory | pwd |
ls | List files in current dir | ls -la |
cd | Change directory | cd /tmp |
Paths
- Absolute paths start at
/, e.g./home/learner. - Relative paths start from where you are, e.g.
../projects.
Special directory shortcuts:
.- the current directory..- the parent directory~- your home directory
Try it
pwd # shows something like /home/learner
ls # list contents
ls -la # long format, including hidden files
cd /tmp # jump to /tmp
pwd # confirm you're now in /tmp
cd ~ # back home
Your notes
Notes are kept on this browser only.
Challenge
From `/home/learner`, change into the `projects` directory.
Need a nudge?
Tip: type the command in the sandbox on the right, or paste the solution here. The sandbox runs in real time.
Quiz
Answer these to lock in the concepts. Score at least 80% to mark the lesson complete.
Mark as complete
Skipped the challenge? You can mark this lesson done by hand.