# Understanding Linux Filesystem

Before we begin, have a good look at the picture below.

![](https://made2ubyvi.wordpress.com/wp-content/uploads/2023/05/filesystem.png?w=950 align="left")

Alright…

The root directory is at the top of the Linux Filesystem hierarchy, represented by a **forward slash (/)**. This is the starting point for all paths in the Linux file system.

The next level down is where the system and configuration files are stored, usually in the **/etc** directory. This includes important files like configuration files for system services and startup scripts.

The **/bin** and **/sbin** directories contain the essential binary files for basic system operations. /bin contains executables that are required for the system to run, while **/sbin** contains executables that are used by the system administrator for system maintenance tasks.

When you install services on a Linux server, let's say, for instance, [Apache Web Server](https://httpd.apache.org/), the config files would most probably located under **/etc** since that is where Linux, by default, adds the config files.

The **/usr** directory contains user-level binaries, libraries, and documentation for installed software. This includes applications installed through package managers like apt, as well as other utilities and libraries.

The **/var** directory contains variable data files, such as log files, spool files, and temporary files. You may find the log files of the server that we talked above in **/var** directory.

The **/home** directory is where user home directories are stored. Each user has a subdirectory here, with their files and settings. When you log in, you may be put in your home directory. As a rule of thumb, I begin my new projects from the /home directory for easy navigation and understanding.

Finally, the **/tmp** directory is used for temporary files that are deleted automatically when the system is rebooted.

I hope this gives you a good overview of the Linux file system hierarchy!

Remember there’s much more to learn as you dive deeper into Linux, but this should give you a solid foundation.
