Sitemap
Ansh

Ansh

Linux file system

3 min readJul 18, 2026

--

Understanding the Linux Folder Structure

Get Ansh’s stories in your inbox

Join Medium for free to get updates from this writer.

The Linux filesystem follows a standardized hierarchy where each directory has a specific purpose. Understanding these directories makes it much easier to navigate Linux systems, troubleshoot issues, and work with containers such as Docker.

Note: In modern Linux distributions (Ubuntu, RHEL, Debian, etc.), directories like /bin, /sbin, and /lib are often symbolic links pointing to their counterparts inside /usr.

Symbolic Links (Modern Linux)

/bin → /usr/bin
Contains essential user commands such as
ls, cp, mv, and cat. In modern Linux distributions, /bin is a symbolic link that points to /usr/bin

/sbin → /usr/sbin
Contains administrative and system management commands such as
mount, fdisk, and ip. It is a symbolic link to /usr/sbin in modern Linux systems.

/lib → /usr/lib
Stores shared libraries and kernel-related files required by applications and system binaries. In modern Linux distributions,
/lib is a symbolic link to /usr/lib.

Core System Directories

These directories are fundamental to the operating system.

/boot
Stores bootloader files, Linux kernel images, and other files required during system startup. This directory is generally
not used inside containers, as containers share the host system's kernel.

/usr
Contains most user applications, libraries, documentation, and shared resources. It is one of the largest directories in a Linux system and holds the majority of installed software.

/etc
Stores system-wide configuration files for the operating system, applications, services, networking, and user settings.

/var
Contains variable data such as log files, cache files, spool files, databases, and application data that changes frequently during normal system operation.

User and Application Directories

These directories store user data and optional software.

/home
The default location for regular users' home directories, where personal files, documents, downloads, and user-specific configurations are stored.

/root
The home directory of the
root (administrator) user. Unlike regular users, the root user has unrestricted access to the entire system.

/opt
Used for installing optional or third-party software packages that are not managed by the system's package manager.

/srv
Stores data served by system services, such as web servers (HTTP), FTP servers, or other network services. This directory is less commonly used in containerized environments.

Temporary and Virtual Directories

These directories are used for temporary storage, runtime information, and communication with the Linux kernel.

/tmp
Stores temporary files created by users and applications. The contents of this directory may be cleared automatically after a system reboot.

/run
Contains runtime information such as process IDs (PIDs), sockets, lock files, and other data required by running processes.

/proc
A virtual filesystem that provides real-time information about running processes and the Linux kernel. It does not contain actual files stored on disk.

/sys
A virtual filesystem that exposes hardware devices, kernel modules, and system information. It is primarily used by the Linux kernel and system utilities.

/dev
Contains device files that represent hardware and virtual devices, such as
/dev/null, /dev/sda, and /dev/tty.

Mount Points

Mount points provide access to additional storage devices and filesystems.

/mnt
A temporary mount point used for manually mounting filesystems, such as external drives, network shares, or additional disk partitions.

/media
Automatically used by Linux to mount removable media such as
USB drives, DVDs, CDs, and external storage devices when they are connected.

/data
A custom directory commonly used as a mount point for
persistent storage, application data, or Docker volumes. For example, it may be mapped to a Windows directory such as C:\ubuntu-data in WSL or Docker Desktop environments.

Quick Summary

/usr → Applications, libraries, and shared resources

/etc → Configuration files

/var → Logs, cache, and changing application data

/home → User home directories

/root → Root user's home directory

/tmp → Temporary files

/proc → Process and kernel information

/sys → Hardware and kernel interface

/dev → Device files

/boot → Bootloader and kernel files

/opt → Third-party applications

/mnt → Temporary mount point

/media → Removable media

/run → Runtime process information

/srv → Service data

/data → Custom mount point or persistent volume

Container Tip: When working with Docker or Kubernetes, you’ll interact most frequently with /usr, /etc, /var, /tmp, /proc, /sys, /dev, and application-specific directories like /app or /data. Directories such as /boot and /srv are typically less relevant inside containers

--

--