*Nix File System Hierarchy Explained

KomSr3ll
2 min readMar 22, 2022

This write-up intents to explain the file system hierarchy of the UNIX or Linux systems, which helps folks learn or do security research. The mentioned operating systems are Unix, Linux, Android, Apple iPhone OS and macOS, respectively, and this is a small list of Operating systems. The different operating systems like FreeBSD, Ubuntu, Android, iOS and OS-X uses the File System hierarchy.

The Unix files system hierarchy is explained below with a reference image.

Unix File System Hierarchy

The slash “/” is the root directory of the entire system, and its subdirectories have their functionality.

“/”: Root Directory of the system

“/bin”: Essential user command binaries, This is where you find most applications keep CLI keeps the binary file.

“/dev”: This is where the system stores the files for the devices integrated with the OS

“/etc.”: The directory that the system uses to store the configurations files to run different applications, even system configuration files as well, e.g., web server, host, DNS ….

“/home”: A directory to store data for any user we create in the system.

“/lib”: The directory contains the library and kernel modules for system use cases.

“/mnt”: The directory mounts the files and storage in the temporary file system.

“/proc”: A directory to store the process and kernel information files

“/root”: A home directory for the ‘root’ user in the system to keep all the information.

“/sbin”: The directory stores the essential binaries for the system operation.

“/tmp”: The directory stores the temporary files and will be swiped at every reboot.

“/usr”: The directory stores the binaries with read-only applications

The below picture gives more context on the file system hierarchy.

Nix File System Hierarchy.
Nix file system hierarchy

PS: This write-up intended to share the information that I know of; I recall a time one of my seniors with good experience in the penetration testing and security assessment was not aware of the same when I had given a talk in my previous company, And If anyone can learn something from this write-up I appreciate claps guys!!, I will be happy, and that gives me motivation.

The write-up would be helpful for the forthcoming write-ups.

--

--

KomSr3ll

Error 404!! Buy me a coffee here, buymeacoffee.com/komsr3ll PS: Sharing my learnings with you. Who am I?