This reference guide describes the key directories found in a typical Linux installation – such as Ubuntu.
Understanding their purpose can help you navigate the Linux file system.
Directory | Purpose |
---|---|
/bin | This directory contains the binary files that are essential for the system to boot and operate. These include the basic commands that are used to control the system, such as ls, cp, and mv. |
/sbin | Similar to /bin, this directory contains binary files that are essential for system administration. These include commands that are used for managing the system, such as fdisk and fsck. |
/boot | This directory contains the files that are needed for the system to boot, such as the Linux kernel and the initial ramdisk. |
/cdrom | This directory is often used to mount a CD-ROM drive. |
/dev | This directory contains the device files that are used to access the system’s hardware, such as the hard disk, keyboard, and mouse. |
/etc | This directory contains the configuration files that are used to control the system’s behavior. These include files that specify the system’s hostname, network settings, and user authentication information. |
/lib, /lib32, /lib64 | These directories contain the shared libraries that are used by the programs in /bin and /sbin. The /lib directory contains the libraries for 32-bit programs, while /lib64 contains the libraries for 64-bit programs. |
/mnt, /media | These directories are often used to mount external storage devices, such as USB drives or network shares. |
/opt | This directory is often used to install optional software packages that are not part of the core system. |
/proc | This directory is a virtual filesystem that contains information about the system’s processes and hardware. |
/root | This is the home directory for the system’s root user. |
/run | This directory contains runtime data that is needed by the system and its programs. |
/snap | This directory is used by the Snap package manager to store installed software packages. |
/srv | This directory is often used to store data that is served by the system, such as web server files or database files. |
/sys | This is another virtual filesystem that contains information about the system’s hardware and kernel. |
/tmp | This directory is used to store temporary files that are created by the system and its programs. |
/usr | This directory contains the user-space programs and data that are used by the system. This includes programs that are used by regular users, as well as shared data and libraries. |
/var | This directory contains data that is expected to change during the normal operation of the system, such as log files and email queues. |
/home | This directory contains the home directories for the system’s regular users. |