If you are new to the Linux operating system, its file structure can be intimidating to navigate, even for a seasoned Windows administrator. Although each developer of a Linux operating system (distro) can customize their distribution’s folder structure, most follow the Filesystem Hierarchy Standard (FHS) maintained by the Linux Foundation. Based on the Unix file system, it establishes the convention for the folder structure used in Linux. The first version of the FHS was released on February 14, 1994 and has evolved ever since to version 3 released on May 18, 2015.
Before exploring the directories, it helps to understand a few differences in how Linux and Windows organize files. If you are familiar with Windows, the following points will help you find your way around Linux.
In Linux, all files and directories are organized under a single directory tree that begins at /, called the root directory. Directories such as /etc, /home, and /var sit beneath it. You can think of / as the starting point for locating any file on your system.
Although everything appears in one tree, the files may be stored on different drives or filesystems. For example, /home may be stored on a separate drive from the rest of the operating system. Linux makes that filesystem available by mounting it at /home. Once mounted, you access its files through /home just as you would any other directory. A directory where a filesystem is attached is called a mount point.
It’s worth noting that the root directory (/) and the root user’s home directory (/root) are different locations. The root directory is the top of the entire directory tree, while /root is normally where the root user keeps personal files and settings.
Back to TopThe directories below are grouped by their main purpose to help you see how they fit together. Some serve more than one purpose, so these groups are a practical guide rather than strict categories.
~ represents the current user’s home directory, so ~/.config would normally mean /home/alex/.config for the user alex. These are common defaults, but applications and user settings may use other locations.
Whether another user can access these files depends on the permissions and security settings; a home folder is not automatically private. Some accounts have home folders elsewhere. For example, the root user’s home folder is normally /root, while accounts used to run system services may have a different home location or no usable home folder.
As a Linux administrator, it helps to know which directories hold long-term data and which contain temporary files. This matters when planning backups, troubleshooting disk space, or deciding where an application should save its information.
The following table summarizes the usual behavior. Your distribution, application settings, and cleanup policies may affect how long files are kept.
| Directory | What's In Here? | Survives a Reboot? | What You Should Know |
|---|---|---|---|
| /etc | System-wide configuration files | Normally, yes | Back up configuration changes so you can restore services and system settings. |
| /usr | Installed programs, libraries, and shared resources | Normally, yes | Manage distribution-provided files through the package manager. Include locally maintained software under /usr/local in your backup planning. |
| /var/lib | Persistent application data, such as databases and service state | Normally, yes | Often essential to recovery. Databases may require application-specific backup procedures to produce a usable backup. |
| /var/cache | Cached data that applications can recreate | Normally, yes, but applications or cleanup tools may remove it | Use the application’s supported cleanup method rather than deleting unfamiliar files. |
| /run | Runtime files, such as service sockets and process ID files | No | Services recreate these files as needed. Do not use this directory for data that must survive a reboot. |
| /tmp | Short-lived temporary files | Not guaranteed | Files may be removed at boot or by periodic cleanup. Do not keep important files here. |
| /var/tmp | Temporary files that need to remain available across reboots | Normally, yes | Cleanup policies may still remove older files. This is not a location for permanent storage. |
A useful distinction is that persistent does not mean permanent. Files in /var/cache and /var/tmp may survive a reboot but still be removed later. Important files should be stored in an appropriate long-term location and included in your backup plan.
Back to TopThe directory layout can vary between Linux distributions. The following commands let you explore your own system without changing files or settings. You can normally run them without sudo.
ls -ld /bin /sbin /lib*
This lists the directories themselves rather than their contents. A line beginning with l identifies a symbolic link, and the arrow (->) shows its destination. For example, you may see /bin -> usr/bin, meaning /bin points to /usr/bin. Your system may have different links or library directories.
To see the full destination of /bin, run:
readlink -f /bin
On a system where /bin links to /usr/bin, the output will be /usr/bin.
lsblk -f
This shows block storage devices and information about their filesystems, including filesystem types, UUIDs, and mount points where available. Look for / in the mount-point column to identify the filesystem used for the root directory. You may also see separate filesystems mounted at /home or /boot.
It’s worth noting that this is a view of block storage, not every mounted filesystem. Virtual filesystems and network shares may not appear here.
findmnt --target /home
This shows the mounted filesystem that contains /home. If /home is on a separate filesystem, the target will normally be /home. If it is an ordinary directory within the root filesystem, the target will normally be /. Some layouts, such as those using Btrfs subvolumes, may show additional details.
You can also compare several locations:
df -h / /home /var
This displays filesystem capacity and available space in a readable format. If these directories share a filesystem, you may see the same filesystem listed more than once. The figures describe the containing filesystem—not how much space each directory’s files use.
Back to TopThe /var directory holds data that changes as your system runs, such as logs, cached files, and application databases. If the filesystem containing /var fills up, services may fail to save data or operate normally. The following checks can help you find where the space is being used.
df -h /var
This shows the capacity and available space of the filesystem containing /var. If /var is not mounted separately, the figures describe the filesystem it shares with other directories, often the root filesystem.
sudo du -x -h --max-depth=1 /var
This summarizes the space used by /var and each directory immediately beneath it. The -h option displays readable sizes, while -x keeps the scan within the filesystem where it starts. The command reads files without changing them, although it may take time on a busy server.
If /var/log stands out, you can look one level deeper:
sudo du -x -h --max-depth=1 /var/log
It’s worth noting that -x skips separately mounted filesystems beneath the directory you are checking. Check those mount points separately if needed.
What you do next depends on the type of data using the space:
On systems using the systemd journal, you can also check its disk usage:
sudo journalctl --disk-usage
This reports the space used by journal files. The journal may be stored under /var/log/journal or /run/log/journal, so its reported size does not always represent space used in /var.
If df reports much more used space than du can account for, a running program may still have a deleted file open. Filesystem snapshots and other storage details can also affect the figures. Investigate the difference before removing more files.
If you would like to learn more about Linux directories or the commands used in this article, the following references are useful starting points. Keep in mind that your distribution may follow different conventions or provide additional guidance.
You can also read the manual pages installed on your system. For example, run man lsblk or man findmnt to learn more about the storage commands used above. Your locally installed manuals normally describe the command versions available on your system.