← Back to Home
πŸ“‚

Linux Filesystem

Learn the Linux directory hierarchy and the purpose of the folders you'll touch every day.

⏱11 min readπŸ“šDevOps Fundamentals

One of the biggest differences between Windows and Linux is how files are organized. Windows uses drive letters like C:\ and D:\. Linux has no drive letters β€” everything grows from a single root directory called /. Think of it as the top of a giant tree.


🎯 Learning Objectives

By the end of this lesson you will:


The Linux Directory Tree

Every Linux system β€” Ubuntu, Debian, CentOS, Amazon Linux β€” follows this structure:

text
/
β”œβ”€β”€ bin     # essential commands (ls, cp, mv)
β”œβ”€β”€ boot    # boot loader files
β”œβ”€β”€ dev     # device files
β”œβ”€β”€ etc     # configuration files
β”œβ”€β”€ home    # user home directories
β”œβ”€β”€ lib     # shared libraries
β”œβ”€β”€ opt     # optional / third-party software
β”œβ”€β”€ proc    # kernel & process info (virtual)
β”œβ”€β”€ root    # the root user's home
β”œβ”€β”€ tmp     # temporary files
β”œβ”€β”€ usr     # installed software
└── var     # logs and changing data

The Directories That Matter Most

Directory Purpose
/ The root β€” everything starts here
/home Personal user folders (/home/student)
/etc Configuration files (/etc/hosts, /etc/passwd)
/var Changing data β€” logs, cache, databases (/var/log)
/tmp Temporary files (may be auto-cleaned)
/usr Installed software and applications
/bin Essential commands like ls, cp, cat
/root The root user’s home β€” not the same as /

⚠ / is not /root

/ is the top of the entire filesystem. /root is just the home directory of the root (admin) user. They look similar but are completely different places.


Moving Around the Tree

bash
cd            # go to your home directory
cd /          # go to the root directory
cd /var/log   # jump to the log directory
ls /etc       # list configuration files
ls ~          # list your home folder

Real DevOps Example

When a web server stops working, a DevOps engineer usually starts by reading the logs:

bash β€” 80Γ—24
student@devops:~$cd /var/log && ls && tail syslog

Many production problems are diagnosed simply by reading /var/log.


πŸ§ͺ Hands-on Lab

πŸ“

Explore the Filesystem

  1. Display your current directory
  2. Go to the root directory and list its contents
  3. Return to your home directory
  4. Display the contents of /etc
  5. Display the contents of /var/log

πŸ’‘ DevOps Tip

You don’t need to memorize every directory β€” just remember the purpose of the important ones: /home, /etc, /var, /tmp, /usr, /bin.


🧠 Knowledge Check

Knowledge Check

Which directory stores configuration files?

Knowledge Check

Where are system logs usually stored?


πŸ’Ό Interview Preparation

Interview Q&A

What is the Filesystem Hierarchy Standard (FHS) and why does it matter?


Summary

You now understand the Linux filesystem hierarchy β€” essential for troubleshooting servers, configuring applications, and working with cloud infrastructure.

Up Next

Linux Permissions

You've mastered this lesson. Continue your journey to becoming a DevOps Engineer.

Start Next Lesson→