All Linux Directories Explained!

All Linux Directories Explained!

Written by Adam. R on Nov 15th, 2021 Views Report Post

The Linux directories are defined by the File System Hierarchy Standard (FHS). To navigate through it with the change directory command: cd.

$ cd ∕

↑ Cd Forward slash drops you into the root folder. Then with the ls command we can list out the contents. lssssssssssss.png


∕bin directory

The ∕bin directory which contains binaries or executables that are essential to the entire operating system. You can run these binaries from the command line at any time. Things like gzip, curl and ls command that we just ran. But confusingly there's also an ∕sbin directory.


∕sbin directory

This directory contains system binaries that should only be executed by the root user like mount or deluser. Many binaries share common libraries. Which are stored in the ∕lib directory.


∕usr directory

The usr directory also has its own bin and s-bin directories. The binaries here are non-essentials to the operating system. It is intended for the end user. You'll also a ∕local directory under the ∕usr directory.


∕local directory

The ∕local directory contains any binaries that you compile manually to provide, that provide a safe place that won't conflict with any software installed by a system package manager. All these binaries get mapped together with $PATH enviroment variable and that's why you can execute them from any directory in the terminal. Now you may want to customize the behavior of the software on your system.


∕etc directory

The etc directory stands for Editable text configuration. Many of these files end in .conf` and typically just text-based config files, that you can modify in your editor. As an operating system, linux can support multiple users in the home directory.


∕home directory

In the ∕home directory you'll find a folder named after each user registered on the system. It contains the files, config and software for that user and you need to be logged in as that user or as root to modify it. Notice how the file path is a squiggly ~, that's your normal starting location when you open up a terminal session. Now let's go back to the root. there are a few more directories we haven't talked about. Like ∕boot.


∕boot directory

It contains the files needed to boot the system like the linux kernel itself.


∕dev directory

The ∕dev directory stands for device files, here you can interface with hardware or drivers as they were regular files. You might create disk partitions here or interface with your floppy drive...


∕op directory

The op directory contains optional or add-on software. You may interact here alot unlike the var directory.


∕var directory

The ∕var directory varible files that will change as the operating system is being used like logs and cache files.


∕temp directory

Temp is for temporary files that won't be persisted between reboots.


∕proc directory

This directory is an illusionary file system that doesn't actually exist on the disk. But is created in memory on the fly by the linux kernel to keep track of running processes.


If you found this usful then please share this and follow me! Also check out my website where I also post everything from here

Comments (2)