paint-brush
Simplifying the Linux Directory Structure [Part 1] by@doublet
287 reads

Simplifying the Linux Directory Structure [Part 1]

by Tito NJune 28th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The root directory is the top most or parent directory that stores all the directories in a Linux system. Every file's absolute path traverses through the root directory since it serves as the parent to all other directories. The root directory houses crucial files by the boot loader, including the kernel and the initial ramram.
featured image - Simplifying the Linux Directory Structure [Part 1]
Tito N HackerNoon profile picture


Linux operating systems run nearly 90% of the world's servers and micro-computers in smart devices. The top reason Linux-based OS are considered for such operations is attributed to:


  • Stability and security: Linux is known for its stability and security. This is due, in part, to the fact that Linux is a monolithic kernel, which means that all of the core components of the operating system are tightly integrated. This makes it more difficult for attackers to exploit vulnerabilities in Linux.


  • Performance: Linux is a very efficient operating system. This is due in part to the fact that Linux is designed to be lightweight and modular. This means that Linux can run on a wide variety of hardware, from old laptops to powerful servers.


  • Customization: Linux is highly customizable. This means that you can tailor the operating system to your specific needs and preferences. There are many different Linux distributions available, each with its own set of features and customization options.


Of course, no operating system is perfect. Linux also has some disadvantages, such as:


  • Linux can be difficult to learn: Linux is a complex operating system. It can be difficult to learn, especially if you are used to Windows.


  • Linux has a smaller software selection than Windows: There are fewer software packages available for Linux than for Windows. However, there are still many great software packages available for Linux.


  • Linux support can be difficult to find: If you need help with Linux, you may have to search online forums or chat rooms. There are fewer Linux support options than Windows. Overall, Linux is a great operating system with many advantages. However, it is important to be aware of the disadvantages before you decide to switch to Linux.


For the purpose of this topic, let's dive into Linux Directory Structure, we shall have another session to discuss Linux-based-OS in depth.


Illustration of Linux Directories Structures

fig. 1.0 Linux Directories

As shown above, we shall discuss these directories in two posts.


Let's get Started!


(/)root

This is the topmost or parent directory that stores all the directories in a Linux system. Every file's absolute path traverses through the root directory since it serves as the parent to all other directories.


Image description

/boot

Don't modify any file in this directory!

The boot directory houses crucial files required by the boot loader, including the kernel and the initial ram file system (initramfs). It is advised not to modify this directory on your main machine, as it can have significant consequences. If you wish to experiment, it is recommended to do so within a virtual machine, where any potential issues can be contained.


Image description

/etc

The /etc directory can be a source of confusion when it comes to naming conventions. Its name originated from early Unix systems, where it was simply called "et cetera" because it served as a miscellaneous storage location for system files that administrators were uncertain where else to place.


In modern times, it would be more appropriate to interpret "etc" as an abbreviation for "Everything to configure." This directory houses a wide range of system-wide configuration files, encompassing various aspects. For instance, you can find files containing the system's name, user accounts and passwords, network machine names, and specifications on how and where hard disk partitions should be mounted.


If you are new to Linux, it is advisable to exercise caution and refrain from making extensive modifications in this directory until you have gained a better understanding of how the system operates.


Image description


/dev

Several of these files are created during the boot process or dynamically as needed. For instance, when you connect a new webcam or a USB pen drive to your machine, a corresponding device entry will automatically appear in this directory.


In Linux, the principle of treating everything as a file extends to hardware components as well. The /dev directory holds special virtual files that represent various hardware elements such as a mouse, keyboard, storage devices, and more, which are connected to your system.



Image description

/home

The /home directory is the designated location for users' personal directories. In my situation, there are two directories under /home: /home/tito, which holds all of my personal files.

In terms of functionality, the /home directory is similar to the C:/Users directory in a Windows environment. It stores individual user configurations within each user's specific directory, allowing for personalized settings and files.



Image description


/usr

In the early days of UNIX, the /usr directory served as the location for users' home directories. However, as we mentioned earlier, the /home directory is now the designated place for users to store their personal files.


In modern times, the /usr directory has evolved to become a diverse collection of subdirectories that house applications, libraries, documentation, wallpapers, icons, and various other resources required to be shared among applications and services. It has become a repository for a wide range of items necessary for the functioning and support of software and services.


Image description


/tmp

The /tmp directory serves as a storage location for temporary files that are typically generated by the applications you are running. These files and directories often (though not always) contain data that an application doesn't require immediately but might need at a later point.


Image description


/lib

The /lib directory is the designated home for libraries. Libraries are files that contain code utilized by your applications. They consist of code snippets that applications utilize to perform various tasks, such as rendering windows on your desktop, managing peripherals, or saving files to your hard disk.


While there are multiple lib directories spread across the file system, the one directly attached to / holds particular significance. It houses crucial components, including the essential kernel modules. Kernel modules serve as drivers responsible for enabling the functionality of various hardware components such as video cards, sound cards, WiFi adapters, printers, and more.


Image description



In conclusion, we have explored the first part of the simplified Linux Directory Structure. We have learned about important directories such as /root, /boot, /etc, /dev, /usr, and /lib, understanding their significance and the types of files they contain.


This overview provides a foundation for further exploration into the Linux Directory Structure. In the upcoming second series, we will delve into additional directories, uncovering their roles and functionalities within the Linux operating system.


By gaining a better understanding of the directory structure, you will be equipped with valuable knowledge to navigate and manage your Linux system effectively. Stay tuned for the next installment as we continue our exploration of the Linux Directory Structure.


Also published here.

Lead image source.