Linux File System 101

Saeed Mohajeryami, PhD
The Startup
Published in
12 min readApr 26, 2020

--

Ancient index-card file system

Linux file system follows a tree-like hierarchical structure starting at the root. It consists of directories, sub-directories, and data files. This structure follows a standard layout recommended by Filesystem Hierarchy Standard (FHS), which is a standard maintained by the Linux Foundation.

Below, I provide a picture of a tree-like structure of the root directory.

Tree-like view of folders sitting on the root

Before moving forward, I want to emphasize a point that is unique to Unix-like systems. These systems intend to keep things simple and treat every thing as a sequence of bytes. These sequence of bytes are known as files to the OS. So, in that sense, everything is a file. Even your hardware devices are files. Your printer is a file, your memory is a file, basically everything. This approach has allowed these systems to become extremely flexible. Since I believe the internal workings of Linux directories has some merits to learn, I have created a section at the end of this tutorial to explain it in detail. However, for now, I skip this topic because you might get sidetracked.

Unlike Windows which has multiple roots, the Linux only allows one root. Below, you can see a picture of standard folders on the root directory. The root…

--

--

Saeed Mohajeryami, PhD
The Startup

Senior Data Engineer @Ascertain, New York, New York. SUBSCRIBE to my free newsletter https://techleadcuriosity.substack.com/