Filesystem and Navigation
Learn how Linux organizes files, how paths work, and how to move confidently using pwd, ls -la, cd, mkdir, and touch.
Learn how Linux organizes files, how paths work, and how to move confidently using pwd, ls -la, cd, mkdir, and touch.
By the end, a beginner should be able to navigate safely, understand basic paths, read simple directory listings, and create a practice directory and file.
Linux has a single filesystem tree. Everything starts at /, called the root directory. Drives, users, logs, configuration, devices, and programs all appear somewhere under this tree.
The root directory is the top of the Linux filesystem. Every absolute path starts here.
/ is the root directory. /root is different; it is the home directory of the administrative root user./ is the city gate. /home is the residential area. /etc is the control room. /var/log is the incident diary. You move through the city using cd and inspect places using ls.
This table is intentionally beginner-friendly. It is not the full filesystem standard, but it covers the places you will meet early in real Linux administration.
| Directory | Simple meaning | Real-world use | Beginner caution |
|---|---|---|---|
/ | Start of everything | Top of the filesystem tree | Do not randomly create or delete things directly under /. |
/home | User personal spaces | Regular user files and dotfiles like .bashrc | Best place for beginner labs. |
/etc | System settings | Configuration files for OS and services | Inspect carefully; edit only when you know the service and have backup/permission. |
/var | Changing data | Logs, cache, spool, application data | Large logs can fill disks. |
/var/log | System/application logs | Troubleshooting boot, service, auth, package issues | Log names differ by distro/service. |
/tmp | Temporary workspace | Short-lived temporary files | Do not store important long-term data here. |
/usr | Userland software/resources | Programs, libraries, documentation | Usually managed by packages, not manual editing. |
/bin | Essential commands | Commands needed for basic system use | On many modern distros, /bin may link to /usr/bin. |
/root | Root user's home | Administrative user's personal directory | Not the same as /. |
/dev | Device files | Disks, terminals, random devices | Do not modify device files casually. |
/proc | Kernel/process info | Live process and kernel information | Virtual filesystem; not normal files on disk. |
/sys | Kernel/device model | Hardware/kernel interface | Advanced area; mostly read-only for beginners. |
An absolute path starts from /. A relative path starts from wherever you are right now.
Starts with /. It works no matter where you are.
student@linux:~$ cd /etc student@linux:/etc$ pwd /etc
Memory hook: absolute path = full GPS address.
Does not start with /. Linux interprets it from your current directory.
student@linux:~$ cd linux-lab student@linux:~/linux-lab$ pwd /home/student/linux-lab
Memory hook: relative path = βturn left from hereβ.
Assume you are currently in /home/student. Choose a command and predict where you land.
/home/studentDocuments, documents, and DOCUMENTS can be three different names.
These are the minimum commands for beginner filesystem navigation.
pwdPrint Working Directory. Shows where you are now.
$ pwd /home/student
lsLists visible files and directories in the current directory.
$ ls linux-lab
ls -laLong listing, all entries, including hidden names that start with ..
$ ls -lacdChanges directory. Example: cd /etc, cd ~, cd ...
$ cd /etcmkdirMakes a directory in the current location unless you give a path.
$ mkdir linux-labtouchCreates an empty file if absent, or updates timestamp if it already exists.
$ touch file1.txtls -la, ls is the command. -l means long format. -a means all files. -la is just -l and -a combined.ls -la: read the evidence board π΅οΈls -la is not just a list. It tells you file type, permissions, links, owner, group, size, date, and name.
Each field explains something different about the file. Start with the leftmost field.
drwxr-xr-x 2 student student 4096 Aug 17 23:05 linux-lab -rw-r--r-- 1 student student 0 Aug 17 23:05 file1.txt
First character d means directory. First character - means regular file.
$ ls -la ~ .bashrc .profile .ssh
A hidden file is simply a name that starts with a dot. It is hidden from plain ls, but shown by ls -a or ls -la.
Run these commands on Ubuntu, Debian, Rocky Linux, RHEL, Fedora, or most Linux distributions. The exact username and file dates may differ.
sudo.$ pwd/home/studentYour output uses your actual username, for example /home/jp.
$ ls -ladrwx------ ... student student ... .
drwxr-xr-x ... root root ... ..
-rw-r--r-- ... student student ... .bashrcYou should see hidden entries beginning with .. Exact files differ by distro and shell.
$ cd /etc $ pwd
/etc/etc is absolute, so it works from anywhere.
$ cd ~ $ pwd
/home/student~ means your home directory.
$ mkdir linux-lab $ cd linux-lab $ pwd
/home/student/linux-labIf mkdir linux-lab says βFile existsβ, the directory already exists. Use cd linux-lab or create a different name.
$ touch file1.txt $ ls -la
-rw-r--r-- 1 student student 0 Aug 17 23:05 file1.txttouch creates the file if it does not exist. If it already exists, it updates the timestamp.
$ cd ~ $ pwd /home/student $ rm -r linux-lab
rm -rf / and careless rm -rf *.
Use this after the guided lab. Try each task first, then reveal the answer.
Click a mistake and learn what happened before it happens on a real server.
Each explanation gives the symptom, the cause, and the safer fix.
Filesystem navigation is not theory. It is the first step in troubleshooting almost every Linux issue.
$ cd /etc $ ls
Used when checking OS, network, user, SSH, web server, and service configuration files.
$ cd /var/log $ ls
Used when services fail, login breaks, packages fail, or the system behaves strangely.
$ cd ~ $ pwd
Used when you want to work in your own user space instead of sensitive system directories.
pwd. Before deleting anything, run pwd and ls -la. Tiny habit, huge accident prevention.Teaching it back is one of the fastest ways to retain it. Write a short answer, then compare with the model answer.
Explain the difference between /etc and etc.
/etc is an absolute path because it starts from /. etc is a relative path because Linux searches for an etc directory inside the current directory.Why does ls not show .bashrc, but ls -la does?
. are hidden from normal ls. The -a option means βallβ, so ls -la shows hidden entries too.Complete this without looking at answers first. Then use the checklist to verify.
$ pwd $ ls -la $ cd /etc $ pwd $ cd ~ $ mkdir linux-lab $ cd linux-lab $ touch file1.txt $ ls -la $ cd ~
Answer all questions. Score guidance: 8β10 = ready for next module, 5β7 = review paths and lab, 0β4 = repeat guided mode with the coach.
Use this during training. It turns passive watching into active practice.
This is the keep-forever part. Print it or keep it beside your terminal.
pwd | Show current location |
ls | List visible files |
ls -la | Long listing with hidden files |
cd /etc | Go to absolute path /etc |
cd ~ | Go to your home directory |
cd .. | Go one level up |
mkdir linux-lab | Create a directory |
touch file1.txt | Create empty file or update timestamp |
/ | Root directory; top of filesystem |
~ | Your home directory |
. | Current directory |
.. | Parent directory |
.bashrc | Hidden file because name starts with dot |
| Absolute path | Starts with / |
| Relative path | Starts from current directory |
pwd, then ls -la, then carefully check the target.Use this to confirm the lab worked on a learner machine.
$ cd ~ $ mkdir -p linux-lab $ touch linux-lab/file1.txt $ test -d linux-lab && echo 'PASS: linux-lab exists' $ test -f linux-lab/file1.txt && echo 'PASS: file1.txt exists' $ pwd $ ls -la linux-lab
pwd shows your home directory, and ls -la linux-lab shows file1.txt.