Deep Dive into Essential Directories
Ilyas Filali
Posted on July 29, 2024
/bin — The Command Center/bin — The Command Center
The /bin
directory is the command center of your Linux system. It houses essential binary files that are crucial for the system’s booting and basic functions. Programs like bash
(the default shell), login
, and cp
(for copying files) are found here. It’s important to note that the binaries in this directory are vital for system operation, so you should never modify or delete them.
/boot — The Bootstrapper/boot
When your computer powers on, the first place it looks for instructions on how to proceed is the /boot
directory. This directory contains the core assets required for booting the system, including the bootloader configuration and the Linux kernel image. Tampering with files in this directory can render your system unbootable, so exercise caution.
/proc — A Window into Processes/proc
The /proc
directory provides a window into the inner workings of your Linux system. It is a virtual filesystem maintained by the kernel, and it houses information about all running processes. Each process has a corresponding directory named after its process ID (PID), containing a wealth of information about that process. While you shouldn’t modify anything in this directory, it’s an excellent resource for monitoring and troubleshooting processes.
/var — The Hub of Variable Content/var
The /var
directory is where files of variable size and content reside. Commonly, log files are stored here, making it an essential location for monitoring system activity and diagnosing issues. Additionally, web servers often store their frontend assets in /var/www/html
.
/mnt — Point for Devices/mnt
By convention, all devices manually mounted onto the system are placed in the /mnt
directory. When you connect an external device or network share, Linux typically mounts it here. This directory keeps your mounted devices organized and easily accessible.
/media — Automatic Device Mounting/media
The /media
directory is reserved for the automatic mounting of devices, such as USB drives. When you plug in a USB drive, Linux takes care of mounting it in this directory, making it accessible to users.
/dev — Device Files Galore/dev
The /dev
directory contains special files that represent all devices mounted on your system. For instance, when you attach a new EBS volume to your Linux-based EC2 instance, you’ll likely see it as “/dev/sda1”. Additionally, you may have encountered commands that send output to “/dev/null” to discard it.
/etc — Configuration and Initialization Scripts/etc
/etc
is a critical directory housing system-wide configurations and scripts that run during system boot and initialization. What sets it apart is that all files within /etc
are text-only, making them easily readable and editable by administrators for system customization.
/tmp — The Temp File Repository/tmp
The /tmp
directory serves as a repository for temporary files generated by various processes. It’s important to note that files in /tmp
are typically deleted when you reboot your system, so it’s not a suitable location for storing important data.
/lib — The Library of Dependencies/lib
/lib contains libraries required by programs in /bin
. These libraries are essential for the proper functioning of these system-critical programs. In addition to /lib
, you may also come across /usr/lib
, which houses libraries for user-space programs, extending the support system for user applications.
/root — The Root User’s Home
The /root
directory is the exclusive home directory of the root user in Linux. As a regular user, you may not have access to this directory, as it’s reserved for system administration tasks.
/usr — User’s Playground/usr
The /usr
directory is where Linux users find a plethora of programs directly usable in their daily tasks. Exploring /usr/bin
unveils a treasure trove of user-friendly applications and utilities.
/home — Personal User Spaces
Last but not least, the /home
directory is where each regular user on the system has their personal space. For instance, if your username is “ben,” you’ll find your files and configurations in /home/ben
. Keep in mind that your access to other users’ home directories depends on your permissions.
Posted on July 29, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.