DEV Community

Cover image for Deep Dive into Essential Directories
Ilyas Filali
Ilyas Filali

Posted on • Updated on

Deep Dive into Essential Directories

Image description

/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.

Image description

/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.

Image description

/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.

Image description
/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.

Image description

/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.

Image description

/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.

Image description

/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.

Image description

/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.

Image description

/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.

Image description

/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.

Image description

/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.

Image description

Top comments (8)

Collapse
 
fredg_prod profile image
Frédéric G. (FredG_ProD)

nice ! A good summary, especially with these drawings

Collapse
 
nayetwolf profile image
Ilyas Filali

Thank you! I'm glad you liked the summary and the drawings <3

Collapse
 
martinbaun profile image
Martin Baun

Great! Saved!!

Collapse
 
nayetwolf profile image
Ilyas Filali

Glad you found it useful! Thanks for saving!

Collapse
 
nebulonix profile image
Nebulonix

Great, thanks for this!
The /mnt is duplicaded though

Collapse
 
nayetwolf profile image
Ilyas Filali

Thanks for pointing that out! I'll fix the duplication in /mnt.

Collapse
 
jayantbh profile image
Jayant Bhawal

Great stuff!
The first image was originally shared by a friend of mine (as attributed in the image), you might like his other stuff too: linkedin.com/in/raghavdua/

Collapse
 
nayetwolf profile image
Ilyas Filali

Thanks! I’ll check out your friend’s work. Appreciate the recommendation!