What is the Linux file system? How are files and folders on a Linux system are organized? If you are asking questions like these, then this article is for you. I assume you are a complete beginner and you want to understand the basic concepts behind the Linux file system.
Also, if you are interested in a video version of this article then check out the following course from LinkedIn Learning:
The Linux File System
Think of the Linux file system as a tree in which the branches are folders or files which are connected to one another. We see it as a tree because the Linux file system follows a tree-like structure.
The root directory is present at the top of the file system. As a result, under it are the child directories or the subdirectories.
The child directories or the subdirectories can also contain other directories or files in them.
From the image above you can see that there is a ‘home’ directory. This directory holds the home directories of specific users. Everything under a user’s home directory belongs to that particular user.
Permissions
A user will have full control of the files and folders that are under his/her home directory. But apart from that, the user will not have any authority on the files above their home directory.
Now, you may ask how do you edit and modify the directories under the root directory. Well for that you require root privileges.
The Linux file system gives that authority to a root user who has the privileges to affect the special directories. Therefore, the root user has complete power over the whole Linux file system.
Directories
A list of directories and their descriptions:
- / – This directory is the root of all the directories which is at the top of the Linux file system. This directory basically holds everything.
- /bin – Stores binary files.
- /boot – Contains files such as boot files, Kernel and other config files related to the bootloader.
- /dev – This directory contains files that represent system devices.
- /etc – Contains system configuration files.
- /home – This directory stores the home directories of all the users.
- /media – Removable media like USB, external hard drives, etc mount on this directory.
- /lib – Stores shared libraries, which the application in /bin and /sbin requires to boot the system.
- /mnt – A different mount point for external devices. Although the /media has taken its place, it can also be used.
- /opt – Stores optional or third party software.
- /proc – Stores information relating to the system resources.
- /root – This is the home directory of the root user.
- /sbin – Contains files and commands for the root user or the system administrator.
- /tmp – Stores temporary files that are used when running an application.
- /usr – Contains data that are binaries, programs and documentation of programs pertaining to users.
- /var – Contains variable files such as log files, mail queue, system log files, etc.
Conclusion
It is easy overwhelming at first when you try to learn about the Linux file system. Therefore, to get familiar you have to navigate around the Linux file system. And explore the structures practically for some time.
Interested in learning more about Linux & Linux administration, then you definitely want to check out the following courses from LinkedIn Learning with 30-day FREE trial:
Click here to learn more about FREE 30-day trial with LinkedIn Learning.
Comment below if there is any specific Linux topic that you want to learn. What do you want to learn next about Linux?