DEV Community

Cover image for The Linux File System: A simple guide for beginners

The Linux File System: A simple guide for beginners

If you want to master Linux, you need to know how the Linux File System works. Why not start now?


When I started using Linux, coming from Windows, I was a bit lost with all the new directories in Linux. Sometimes their names are intuitive (/home, /boot...), but most of the time I didn't understand what they were used for.

Fear not. Today you are going to learn what are each directory for in no time. Let's go!

Linux directories


The root directory. This marks the start of the Linux File system and it is the highest level. All the files and directories are stored here.


Bin contains binary executables (the Linux version of Windows .exe files). These include the commands you use in the terminal (cat, mkdir, ls, cat...). As you may have guessed, the name of this directory comes from BINaries.


One of the main directories. Here are stored the files used to boot the system successfully. You shouldn't touch this directory.


This contains files of devices connected to the system. For example, when you connect a USB, but also hard drives.


As the name says, it is... etcetera. It stores configuration files required by the system. For example, /etc/shadow, /etc/passwd, etc. Again, you shouldn't touch this directory. And if you do, make a copy of the files you modify (I destroyed my Ubuntu virtual machine messing around with this. Luckily I had a snapshot saved...)


Here you will find the private directory of each user. It contains user directories such as /Downloads, /Documents, /Desktop, etc. The exception is root, which has its own directory.


It contains libraries of different applications. The package manager controls and manages this directory automatically. These are essential files that you shouldn't mess around with.


Contains (temporal) directories of removable media (for example, when you connect a USB, you can find it at /media//.


This is the /media directory of the past. Here the CD ROM readers were mounted, but no longer is used.


Here are stored the software packages provided by a third party, not installed with the package manager (generally, apt-get). Each application has its own directory inside /opt, containing the files needed to run.


Contains information about running processes and your computer: CPU, RAM, kernel, etc. The files here are generated at your computer start-up and deleted when powered off.


The home directory of the root account. Despite being a kind of "user directory", it has a different structure than the average user.


One of the newest directories. It contains temporal files that use the RAM memory. Once the computer is powered off, the files disappear.


Similar to the /bin directory, but for the root user. It contains special binaries and command line tools used by root. For example, the reboot file that only the admin user can use it is stored here.


Contains information about devices, drivers and kernels. This directory is managed automatically by Linux.


Contains information about services, specific to your Linux distribution. This directory is managed automatically by Linux.


Contains temporal files, created by running applications, the system or users. Once your computer is powered off, these files are deleted.


This directory contains libraries, binaries and documentation of the installed programs, that are shared between all the users.


Standing for variable, /var directory contains files that are constantly changing, such as log files, events or spool files.

Final thoughts

Understanding and remembering all the directories in Linux it will take your time. Don't try to memorise it as if you were studying for it: Just by using Linux as you should (using the terminal!) you will get used to it. When you always start in /home/, you will learn that all the users have their own directory there. When you connect a USB to your computer, you will find it at /media, and you will remember that that's the purpose of that folder.

Just keep using Linux and you'll get the hang of it in no time :)

Or you can do one of the Linux courses I'm doing right now.


Linux courses
Original post: The Linux File System: A simple guide for beginners

Top comments (0)