Understanding the Linux File System Hierarchy: A Complete Guide for Beginners
When you first switch from Windows or macOS to Linux, the file structure can look like a confusing maze of short, cryptic folder names. Unlike Windows, which uses a "C: Drive" as the root, Linux follows a unified structure known as the Filesystem Hierarchy Standard (FHS).
In these notes, we will break down exactly where every file lives in your Linux system, why the directory structure is built this way, and the essential commands you need to navigate it like a pro.
What is the Filesystem Hierarchy Standard (FHS)?
The FHS is a set of guidelines that defines the main directories and their contents in Linux operating systems. Because of this standard, whether you are using Ubuntu, Fedora, Arch, or Kali Linux, the configuration files will almost always be in /etc and your user files will always be in /home.
The Root Directory ( / )
Everything in Linux starts at the Root. It is represented by a single forward slash (/). Unlike a tree on earth, the Linux tree grows downwards from the root.
1. /bin – Essential User Binaries
The /bin directory contains the executable programs (binaries) required for the system to run in single-user mode. If you are using basic commands, you are likely executing files from here.
Common files found here:
ls,cp,mkdir,cat,ps.Note for TodayNotes: In modern 2026 Linux distros,
/binis often a symbolic link to/usr/bin.
2. /boot – Static Boot Loader Files
This is one of the most critical directories. It contains everything needed to boot the system.
Contents: The Linux Kernel (
vmlinuz), the RAM disk image (initrd), and the GRUB bootloader settings.Pro-Tip: Never delete files in this folder unless you are upgrading your kernel, or your system will fail to start!
3. /dev – Device Files
In Linux, "Everything is a file." This directory contains files that represent hardware components.
Examples:
/dev/sdarepresents your hard drive, and/dev/nvidia0might represent your GPU.Note: You don't "edit" these files; the system uses them to communicate with hardware.
4. /etc – Configuration Files
Think of /etc as the "Control Panel" of Linux. It contains all the system-wide configuration files.
Key Files: *
/etc/passwd: User account information./etc/fstab: Information about disk drives and mounting./etc/hosts: Local IP to hostname mapping.
SEO Insight: If you are writing a tutorial on "How to change a static IP," the reader will always look in the
/etcfolder.
5. /home – The User Space
This is where you live. Every user on the system (except the Root user) has a subdirectory here.
Path:
/home/yournameContents: Your Documents, Desktop, Downloads, and personal configuration files (hidden files like
.bashrc).
6. /root – The Superuser Home
Don't confuse / (root directory) with /root (root user's home). To maintain security, the administrative "root" user has their own separate home folder outside of the standard /home path.
7. /lib, /lib32, /lib64 – Essential Shared Libraries
These directories hold the library files that the binaries in /bin and /sbin need to run. They are similar to .dll files in Windows.
8. /media and /mnt – Mount Points
** /media:** This is where the system automatically mounts "removable" media like USB drives or external SSDs.
** /mnt:** This is a place for administrators to "manually" mount temporary filesystems (like a network drive).
9. /opt – Optional Add-on Apps
When you install third-party software that doesn't follow the standard Linux package format (like Google Chrome, Zoom, or certain proprietary tools), they often install into the /opt directory.
10. /proc and /sys – Virtual Filesystems
These are "pseudo" directories. They don't actually exist on your hard drive.
** /proc:** Contains information about running processes and system resources (like CPU info).
** /sys:** Used for interacting with the kernel and hardware drivers.
11. /sbin – System Binaries
Similar to /bin, but contains "System Admin" tools. These are commands typically run by the root user for system maintenance.
Examples:
iptables,fdisk,reboot,shutdown.
12. /tmp – Temporary Files
Applications use this folder to store temporary data.
Crucial Note: In most Linux distributions, the contents of
/tmpare deleted automatically every time you reboot.
13. /usr – User Binaries & Data
Historically standing for "Unix User Resources," this is now the largest directory in many systems. It contains the majority of user utilities and applications.
/usr/bin: General user executable files./usr/share: Architecture-independent data (like icons, fonts, and documentation).
14. /var – Variable Data Files
This is where the system stores data that is constantly changing.
** /var/log:** The most important folder for troubleshooting. It contains all system and application logs.
** /var/www:** The default location for web server files (like your HTML/CSS files if you run Apache).
** /var/mail:** Where system emails are stored.
Comments