Understanding the Linux Filesystem: A Beginner's Guide
Explore the Linux directory structure and how it all fits together

Hi there 🤗 , I am Mary Okosun! I am a back-end developer based in Lagos, Nigeria. I enjoy writing about my experiences and new technologies in JavaScript and its frameworks. When I am not coding or writing articles, I see a movie or play volleyball.
What is the Linux filesystem?
As a DevOps engineer, understanding the Linux filesystem is one of the first foundational skills you need. When you SSH into a Linux server to investigate a failed deployment, check application logs, modify a service configuration, or troubleshoot disk space, you are interacting with the Linux filesystem.
Linux powers a large portion of modern infrastructure, and even when you're working with technologies such as AWS, Azure, Docker, Kubernetes, or CI/CD tools, Linux is often running underneath these technologies.
The Linux filesystem is how Linux organises files, directories, configurations, applications, logs, and other resources. Once you understand where these things live, navigating a server and troubleshooting problems becomes much easier.
In this article, we'll explore some of the most important Linux directories, what they contain, and why they matter to a DevOps engineer.
Linux filesystem hierarchy
Core filesystem
- The
/rootdirectory
The root directory is the top-level directory of a Linux filesystem. It is represented by the symbol /. It can also be described as the starting point of all files and directories in Linux.
/
├── etc
├── home
├── opt
├── tmp
├── usr
└── var
Unlike Windows, where you may be familiar with drives such as C:\ and directories such as C:\Users or C:\Program Files, Linux uses a single directory tree. Everything starts from a directory called the **root directory**, represented by /.
From /, other directories branch out to form a hierarchical, tree-like structure.
It's important to note that the root directory
/is different from the root user, which is the Linux superuser.
- The
/homedirectory
The /home directory is directly under the root directory / and it contains personal files and folders for users. This is where users would typically store their documents, projects, downloaded files, etc.
If your Linux username is mary, your home directory would be
/home/mary
This is important as each user would typically have their own home directory, which provides a separate space for their personal files and projects.
- The
/etcdirectory
The /etc directory contains system-wide configuration files and configuration files for many installed applications.
For example, if Nginx is installed on a server, you may find its configuration under:
/etc/nginx/
You may also come across files such as:
/etc/hosts
/etc/ssh/sshd_config
The /etc/hosts file can be used to manually map hostnames to IP addresses, while SSH configuration files control how the SSH server behaves.
As a DevOps engineer, you'll frequently work with /etc when configuring servers and applications, managing services, troubleshooting networking issues, or modifying system settings.
When you know where an application's configuration lives, you know where to look when something isn't working as expected.
- The
/vardirectory
The /var directory contains files that change frequently while the system and applications are running. There are several important subdirectories, including:
/var
├── log → system and application logs
├── cache → cached application/package data
├── lib → persistent application/system data
└── tmp → temporary files
One of the most important is the /var/log directory. This contains the system and application logs.
Imagine Nginx suddenly stops serving requests. You check the configuration under /etc/nginx, but the configuration looks correct. Your next step might be to inspect /var/log/nginx/ for errors.
Learning to read logs is one of the most useful Linux troubleshooting skills a DevOps engineer needs to have in their stack.
- The
/usrdirectory
This directory contains most of the programs, libraries, and other resources used by users and applications. It generally contains software managed as part of the operating system.
/usr
├── bin → user commands and executable programs
├── lib → libraries used by programs
├── local → software installed locally by the administrator
└── share → architecture-independent data such as documentation
You will frequently encounter /usr/bin when working with Linux commands. For example, a command such as ls may be located at /usr/bin/ls

