Linux Root Directory (Linux)

Root directory layout

Have you ever run the ls command on the root of a Linux system and wonder what all the directories are and what they contain?

The root directory layout of a Linux system can initially seem a little confusing, with directories like /usr being name user but not really being used as a location for users files.

For this blog post I am going to be using a Raspberry Pi 4 and Raspbian (Linux) to take a brief look at the Linux root directory.

Directory Layout

Root directory layout
Root directory layout

When the ls command is run at the root it returns the following directories:

  • bin
  • dev
  • home
  • lost+found
  • mnt
  • proc
  • run
  • srv
  • tmp
  • var
  • boot
  • etc
  • lib
  • media
  • opt
  • root
  • sbin
  • sys
  • usr

The Directories


The linux /bin directory

bin is short for binary, and the /bin directory is where executables (e.g. programs) in binary format are stored. When you run ls, cp, grep, chmod etc they are all binaries stored in this directory.


The linux /dev directory
The linux /dev directory

Contains various device files that the Linux system relies on, including devices Linux installed during the operating system installation.


Contains the user’s home folder, which then contains the user’s deskop, documents etc.


If the fsck command finds any data corruption on a partition it places the corrupted data into the lost+found directory.


Can be used to mount additional drives into the current file hierarchy.


The Linux /proc directory
The Linux /proc directory

Contains information on currently running processes and system resource usage.


The Linux /run directory

Run time data since the systems last boot.


Server information being served/offered by the computer.


Contains temporary files.


The Linux /var directory

Contains cache files and the log directory.


The Linux /boot directory

Contains the Linux boot loader files.


The Linux /etc directory

Configuration files used by the system or software on the system.


The Linux /lib directory
The Linux /lib directory

Libraries that are called by files in /bin and /sbin.


Location where removable media (e.g. USB pen drives) connect to.


I think this was for “optional” software, i.e. 3rd party software.


The root user’s home directory.


The Linux /sbin directory

System binaries, i.e. the system (s) version of /bin.


System files containing information about the system, devices and the kernel.


Does not contain user files. Large parts of the Linux operating system are contained in the /usr section.

Want To Find Out More?

The best way to learn about Linux is to explore it and that can be done by installing Linux in a virtual machine, booting from a Linux USB drive / Live disc, or installing Linux as your operating system (OS).

Wikipedia on Filesystem Hierarchy.