Common Directories
Solid knowledge of directory structure on the operating system helps you quickly find files during file operations and system management.
The file system uses a hierarchical, tree-like directory structure. The base of the file system hierarchy begins at the root (often referred to as the forward slash / since the full path to it is /). Directories branch off the root. The tree root and branches are directories or folders, whereas leaves are files.
Here are the most common top level directories.
- /bin: command files executable by common users.
- /sbin: commands executable by non-common users. Sometimes, the directory may also hold commands executable by common users.
- /etc: system configuration files.
- /root: home directory for the system administrator (root or admin user).
- /usr: files and directories related to system users, as well as primary programs.
- /home: user home directory in which user files, including configuration files, documents, and data, are located.
- /dev: device files. In Linux, devices are represented by files so that they can be operated in the same way as files are operated.
- /media: file system mount points, which are typically used for installing removable media, partitions of other file systems (for example, DOS), network file systems, or any installable file systems.
- /lib: shared library files used by programs in /bin and /sbin directories.
- /boot: files used for booting the kernel and operating system.
- /var: variable files, including spool directories and files, logging data, lock files, and temporary files.
- /proc: a virtual file system capable of storing memory images of the operating system without occupying disk space.
- /initrd: directory where initrd.img files are mounted at the system boot time and the required device modules are loaded.
- /opt: optional files and programs. The /opt directory is often used by third-party developers to install or uninstall software packages.
- /tmp: temporary files required by users and programs. Files in the /tmp directory are automatically deleted.
- /lost+found: files recovered in system repair.