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.
When the ls command is run at the root it returns the following directories:
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.
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.
Contains information on currently running processes and system resource usage.
Run time data since the systems last boot.
Server information being served/offered by the computer.
Contains temporary files.
Contains cache files and the log directory.
Contains the Linux boot loader files.
Configuration files used by the system or software on the system.
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.
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.
You must be logged in to post a comment.