Skip to content
Beginner LinuxLesson 3 of 27 1 min read

Filesystem Navigation

Move around the filesystem with pwd, ls, and cd.

On this page3 sections

Linux organises everything under a single root directory /. Unlike Windows, there are no drive letters; everything branches off /.

Three commands you will use constantly

CommandWhat it doesExample
pwdPrint current directorypwd
lsList files in current dirls -la
cdChange directorycd /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

Run these in the practice terminal (opens in a new tab). It opens in a new tab, so you keep your place here.
bash
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

Challenge

From /home/learner, change into the projects directory.

Want to experiment first? Try things in the practice terminal (opens in a new tab), then enter the command that solves the task here.

Quiz

Lock in the concepts. Score at least 80% to mark the lesson complete.

0 of 2 answered

Done with this one?

Skipped the challenge? You can mark the lesson complete by hand.

Your notes

Kept on this browser only.