How does the Linux file structure work?
In this post, you will learn how the Linux file structure works and also the most important directories and their functions.
Linux file structure
The first question we have to answer is about the term directory.
Directory in Linux is the same thing as a folder in Windows.
That said, which is a question of many, we can now move on to the file/directory structure.
That is nothing but a set of directories that are common in many Linux distributions, of course, some have a few more directories.
In this post, we will cover all that is in the Ubuntu distribution, since it is the most used.
The / directory is the system root, from there we will see the other Linux directories.
There is no one else before him, only after.
In the bin directory, we will have system executable files.
Some contents of the bin are: shell, ls, tar, kill, grep, echo, cp, rm and mv.
shell would be an application that runs the commands we type in the terminal.
The others are widely used commands, anyone who has used Linux knows. 😀
In the boot directory, we will have files that make the system initialization.
In this directory, we will have files for all input and output devices on the system.
We don’t have drivers like Windows on Linux, we have files that represent all these devices connected to the computer.
In the /etc directory we will find system configuration files.
For example, Apache configuration, which is a web server.
In the /home directory we will have the directories of each user on the system.
So each directory of this contains the unique files of each user.
Contains library files that are shared across applications.
And also files needed to boot the system.
The /media directory is responsible for housing the mounting of the computer’s external devices such as USB sticks.
The /mnt directory serves to temporarily mount devices, partitions, and also file systems, which are on a CDROM, for example.
This directory contains the files of applications that are not official installations.
Similar to /bin, it can contain files that are needed for system startup.
But generally, the files in this directory are only used by the root user (system admin).
The name sbin is short for system binaries.
Temporary files directory, we can insert files that we won’t need in the future, for some testing or checking something in them.
Note: files in this directory can be deleted at any time, that is, it is not a safe place to store files.
Some software suggests that the installation be done in /tmp, after it is completed the installation files are removed from the system.
The /usr directory houses files that are only used in a read-only format by the system.
For example, man command files explaining what each command does and also other types of documentation.
In the /var directory we will have a very large range of variable files.
From log files, MySQL, email inbox files, and even web servers.
Linux file structure conclusion
Important information Directory = Folder
We have several important directories under Linux, of course, you won’t save them all and what they do.
But it’s good to have a superficial notion because some actions we perform use some of these and also to know their importance to the system.
And that’s it for today, until the next post!