dark mode light mode Search Menu
Search

bin, boot, opt, and Linux File System Hierarchy Mysteries

Tristan Schmurr on Flickr

Anyone who has used the Linux operating system has probably been stumped by the odd file folder names used by the software. It’s different from Windows where only a few folder names are mysterious. With Linux, and any Unix-based operating system, every folder name seems cryptic or abbreviated. The folder names are called the file system hierarchy.

Other file system hierarchy differences include:

  • Folders are called directories in Unix.
  • You mount devices like CD-ROMs in Unix, attach or connect them in Windows.

Here’s a table with the most common Unix directory names and their purpose:

 

Folder Name Description
/ This is the top-most level in the Linux operating system. While similar to C:\ in Windows, in Linux drives like D:\ or E:\ appear as directories under the \ directory. In Windows, D:\ and E:\ appear at the same level as the C:\ folder.
bin Critical system programs and utilities are stored in this directory. Software like a Firefox web browser are stored in the /usr/bin directory. bin is shorthand for binary or binaries.
boot This folder holds the files needed to boot (or start up) the operating system. However, the configuration files for booting up are in the /etc directory.
dev Devices such as drives are made available in this directory as files. If you wanted to partition a drive, for example, you would point the partition software to a file in this directory. /dev/null also is a device that discards all input, useful for cron and other software that generates output not needed otherwise.
etc This directory contains all the configuration files for the system. User-specific configuration files are in the /home directory for each user.
home Each user configured in Linux has a directory under the /home directory. For example, Fred Flintstone would have a directory at /home/fred to store his data and configuration-related files.
lib Essential library files for the system binaries in the /bin or /sbin directories are stored here. Individual user-related libraries for /usr/bin are in the /usr/lib directory.
lost+found Any corrupted files from system crashes are stored in this directory.
media When you attach removable media, for example, a CD-ROM or thumb drive, a directory will be created in the /media folder. You can browse the contents of these drives from the /media directory.
mnt This directory is used by system administrators to mount (connect) temporary file systems, for example, to recover files from a drive partition.
opt Proprietary software that does not use the standard Linux file system structure will create directories in the /opt folder to store its files.
proc Linux kernel and process files are stored in the /proc directory. These files include system and process information.
root This is the home directory of the root user. Instead of /home/root, the /root directory is used to store data and configuration-related files for the root user. This also is different from the / (root) directory which holds all Linux directories and files.
run This directory holds temporary application files that cannot be deleted by the Linux system. Temporary files usually are in the /tmp folder where the system can manage and delete files.
sbin Like the /bin directory, this folder contains essential binary files, in this case, binaries run by the root user for system administration tasks.
tmp Temporary files stored in this directory are deleted upon system restart or periodically by software utilities.
usr Applications and files used by individual users are stored in this directory. Binaries are stored in /usr/bin or /usr/sbin directories. Graphic files are stored in the /usr/share directory. Locally compiled applications are stored in the /usr/local directory to keep them apart from other system and user-specific applications.
var The /var directory mirrors the /usr directory. When Linux runs, the /usr directory contents are read-only. Log files and other data that needs to be written is stored in the /var directory, for example, the /var/log directory.

Learn More

The Filesystem Hierarchy Standard

http://www.pathname.com/fhs/pub/fhs-2.3.html
http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

Linux Directory Structure

http://www.howtogeek.com/117435/htg-explains-the-linux-directory-structure-explained/

Related Posts