READDEMOGUIDED LABINDEPENDENT LABQUIZREVIEW
Module 1 of 7 · 20 min Navigating the filesystem
Beginner · 1/5Written 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/studentAbsolute 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_configDemo: try these in the terminal
pwd | confirm your location |
ls -la | see everything, including hidden files |
cd /var/log | jump using an absolute path |
cd .. | go up one level |
tree ~ | see the shape of your home directory |
Quiz
Knowledge quiz · pass mark 80%
- Where are system log files usually stored?
- ls without -a shows files whose names begin with a dot.
- Type the command that prints your current working directory.$
- Type a command that lists /etc in long format.$
- Which of these are absolute paths? (choose all)
- Which directory is the top of the Linux filesystem?
- You are in /home/student. Where does cd ../alice take you?
- What does ~ expand to for the student user?