Unix directory structure
As a new Linux convert, I was initially baffled about the *nix directory structure. Gone was the familiar structure of a Windows system, with its C:/Windows folder hiding the essential system files. Here, everything is on display - and oh, how confusing it all seemed to me. In this article, we'll delve into the most common folders you'll find within a typical Linux root directory.
Inside your root (/) directory, you will most likely find the following directories:
Bin (Binary Files)
The bin folder (/bin) contains executable binary files that are used by the system and users. These files are typically compiled programs that perform specific tasks, such as ls (listing files) or cp (copying files).
Boot
The boot folder (/boot) stores files related to the boot process, such as kernel images, bootloaders (e.g., GRUB), and other initialization files. This folder is critical for booting the system.
Dev (Devices)
The dev folder (/dev) contains device files that represent physical devices or virtual interfaces. These files are used by programs to interact with devices such as hard drives, printers, or network interfaces.
etc (Configuration Files)
The etc folder (/etc) holds configuration files for various system components, such as network settings (e.g., /etc/network/interfaces), user accounts (e.g., /etc/passwd), or system services (e.g., /etc/init.d). These files are used by programs to configure and customize system behavior.
Home (User Home Directories)
The home folder (/home) is where user home directories are stored. Each user has their own subdirectory within this folder, containing their personal files, settings, and configurations. The shortcut to access your own home directory is ~/
Lib (Library Files)
The lib folder (/lib) contains shared library files that are used by programs to perform specific functions or provide additional functionality.
Media (Mount Points) and mnt (Mount Points)
The media folder (/media) and the mnt folder (/mnt) are both used as a mount point for storage devices. Typically, you'd mount USB drives or CDs/DVDs to /media and internal hard drives or SSDs to /mnt.
opt (Optional Files)
The opt folder (/opt) is used for storing optional files or applications that are not part of the standard system installation.
proc (Process Information)
The proc folder (/proc) contains virtual files that provide information about system processes, such as memory usage or running processes.
root (Root User Files)
The root folder (/root) is used for storing files specific to the root user.
run (Run-time Files)
The run folder (/run) is used for storing files that are created during run-time, such as socket files or temporary files.
sbin (System Binary Files)
The sbin folder (/sbin) contains executable binary files that are used by the system for maintenance or administrative tasks.
srv (Service Files)
The srv folder (/srv) is used for storing files related to network services or daemons.
sys (System Configuration Files)
The sys folder (/sys) contains virtual files that provide information about system hardware or kernel configuration.
tmp (Temporary Files)
The tmp folder (/tmp) is used for storing temporary files.
usr (User Programs)
The usr folder (/usr) contains user programs and applications that are not critical for system operation. Do not confuse this with the user directory you had in Windows - this is not where your documents and photos live!
var (Variable Data)
The var folder (/var) contains files that store variable data such as log files, temporary files, or spool files.
And that's it! Depending on your specific Linux distro, some of these directories might be missing, or you might have some extras. If you're not sure what you're doing, try not to mess with the files outside of your home directory too much. When starting out with Linux, I find it's best to follow a step by step guide - of which there are many available online - whenever you wish to do something that can't be easily done through the GUI.