READDEMOGUIDED LABINDEPENDENT LABQUIZREVIEW
Module 1 of 7 · 20 min

Navigating the filesystem

Beginner · 1/5

Written by CoreQ Academy (drafted with AI assistance). Awaiting review by Sean Ofodile.

You will be able to
  • Explain the Linux directory tree
  • Use pwd, ls and cd with absolute and relative paths
  • Read files with cat

One tree, starting at /

Linux keeps everything in a single tree that starts at the root directory /. Configuration lives in /etc, logs in /var/log, user files in /home. There are no drive letters.

Where am I?

pwd prints your working directory. When you log in, that is your home directory, also written ~.

$ pwd
/home/student

Absolute and relative paths

An absolute path starts with / and works from anywhere. A relative path starts from where you are. . means here and .. means the parent directory.

Looking around

ls lists a directory, ls -l adds permissions, owner, size and date, and ls -a includes hidden files that start with a dot.

$ ls -l /etc/ssh
-rw-r--r-- 1 root root 62 Oct  1 09:00 sshd_config

Demo: try these in the terminal

pwdconfirm your location
ls -lasee everything, including hidden files
cd /var/logjump using an absolute path
cd ..go up one level
tree ~see the shape of your home directory

Quiz

Knowledge quiz · pass mark 80%
  1. Where are system log files usually stored?
  2. ls without -a shows files whose names begin with a dot.
  3. Type the command that prints your current working directory.
    $
  4. Type a command that lists /etc in long format.
    $
  5. Which of these are absolute paths? (choose all)
  6. Which directory is the top of the Linux filesystem?
  7. You are in /home/student. Where does cd ../alice take you?
  8. What does ~ expand to for the student user?