The Linux Filesystem

Prajwal Patil
2 min readSep 20, 2021

--

Exploring the directory structure of Linux. Short and quick overview.

Most basic command you need to know is “ls” — lists the contents of directory. Almost every command in Linux have options to pass some arguments to modify their behavior and so does “ls”. Most commonly used options are -l (long listing), -a (list all files including the hidden ones which typically start with a ‘ . ’ ).

Linux filesystem is a inverted tree data-structure where everything starts at root and branches into different directories and files as we go to the levels below. One of the features of Linux filesystem is “Everything is a file”. Above picture lists the directories found on Linux systems. We will have a look at some of these directories -

  1. / — The root directory, where everything begins.
  2. /bin — Contains important binaries (executables/programs) that are needed for the system to boot up and run.
  3. /boot — Contains boot loader (program which loads the kernel into memory and hand control of the CPU over to the loaded kernel), Linux kernel ( /boot/vmlinuz).
  4. /dev — As I mentioned earlier “Everything is a file” also applies to devices. Kernel maintains a list of all the devices it understands in this directory.
  5. /etc — Contains all of the system-wide configuration files. Some interesting file are /etc/crontab , /etc/fstab , /etc/passwd.
  6. /home — Each user is given a home directory usually named after the user/owner in this directory.
  7. /lib — Contains shared library files used by the system programs . They are similar to DLLs in windows system.
  8. /lost+found — This directory is used in the case of a partial recovery from a file system corruption event.
  9. /media — Contains mount points for removable media such as USB drives.
  10. /opt — Used to install optional softwares.
  11. /proc — Proc file system is virtual file system created on fly when system boots and is dissolved at time of system shut down.
  12. /root — This is the home directory for the root user account.
  13. /sbin — Contains system binaries.
  14. /tmp — This directory is intended for storage of temporary, transient files created by various programs.
  15. /usr — Contains all the programs and support files used by regular users.
  16. /var — With exception of /tmp and /home , the other directories stores relatively static data . The data that is likely to change is stored in /var such as various databases, spool files etc.

And this is it. See you again soon. Happy reading!

--

--