Every file on a Linux system sits inside a folder that branches off from a single starting point called the root directory (/). The Linux directory structure follows this tree-like pattern across almost every distribution. The Filesystem Hierarchy Standard (FHS) defines where each folder goes and what it holds. If you manage servers, write scripts, or just want to know where your files live, understanding the Linux directory structure saves you real time.

How the Linux Directory Structure Organizes Data

Linux treats everything as a file. Regular documents, folders, and even hardware devices all fall under this rule. Three main file types exist in the system:

File TypeDescription
Ordinary FilesText documents, images, videos, and programs
Directory FilesContainers that hold other files and subdirectories
Device FilesRepresentations of hardware like drives and keyboards

Unlike Windows, which uses drive letters (C:, D:, E:), Linux places everything under one unified hierarchy starting at /.

Primary Folders in the Linux Directory Structure

The root folder contains several subdirectories. Each one has a specific job.

FolderPurpose
/binStores basic user commands like ls, cp, and cd
/etcHolds system-wide configuration files
/homeContains personal folders for each user
/optHouses third-party applications
/tmpProvides space for temporary data
/usrKeeps user programs and shared resources
/varStores changing data like logs

Additional System Directories in the Linux Directory Structure

/boot

/boot stores kernel files and bootloader configurations. Your system reads these files first during startup.

/dev

/dev contains device files that represent hardware components. For example, /dev/sda1 points to your first hard disk partition.

/lib

/lib holds shared code libraries. Programs in /bin and /sbin depend on these libraries to run.

/proc

/proc is a virtual folder. It displays real-time data about running processes and system status. Files like /proc/cpuinfo and /proc/meminfo let you check processor and memory details without extra tools.

/media and /mnt

Removable drives such as USB sticks appear automatically under /media. System administrators use /mnt for manual mounting tasks.

/sbin

/sbin stores administrative commands. Only root users or those with sudo privileges can run these binaries.

Key Configuration Files in /etc

The /etc folder holds files that control system behavior. You should handle these carefully because a wrong edit can break things.

File PathFunction
/etc/passwdUser account information
/etc/fstabDisk mount point details
/etc/hostsHostname to IP mappings
/etc/crontabScheduled task definitions
/etc/resolv.confDNS server settings

Log Files and Their Location in the Linux Directory Structure

System logs live under /var/log. These records are useful when troubleshooting problems or tracking login activity.

Log FileContents
/var/log/messagesGeneral system activity
/var/log/wtmpLogin history records
/var/log/lastlogRecent login attempts

Reviewing logs regularly helps spot security issues early. You can view these files using commands like cat or less, and file permissions determine who can read them.

Once you know where each directory sits, tasks like copying files between systems get much simpler. Start by exploring your own /home folder, then gradually check system directories to build familiarity with the Linux directory structure.

FAQs

What is the root directory in Linux?

The root directory (/) is the top-level folder in the Linux directory structure. Every other file and directory branches from this single point. It is not the same as the /root home folder.

Where are user files stored in the Linux directory structure?

User files are stored under /home. Each user gets a personal subdirectory, like /home/alice. Only the account owner can access their home folder by default.

What is the difference between /bin and /sbin?

/bin holds commands available to all users, like ls and cp. /sbin contains system administration commands that typically require root or sudo access to run.

Why does Linux use a single directory tree instead of drive letters?

Linux inherited this design from UNIX. All storage devices mount under the single root hierarchy, keeping the file system unified regardless of how many disks you add.

Can I safely delete files from /tmp?

Yes. The /tmp directory holds temporary data and most Linux distributions clear it on reboot. You can delete files manually, but avoid removing anything actively used by running processes.

Willie has over 15 years of experience in Linux system administration and DevOps. After managing infrastructure for startups and enterprises alike, he founded Command Linux to share the practical knowledge he wished he had when starting out. He oversees content strategy and contributes guides on server management, automation, and security.