Linux Cheatsheet - Directory Structure and Important Files Paths

Photo by Derek Oyen on Unsplash

Linux Cheatsheet - Directory Structure and Important Files Paths

Here is my little Linux Cheatsheet for everyone who wants to start using Linux

Hello and welcome to my new serie of articles: Linux Cheatsheet. This will be sort of my memo pads about Linux. But I love sharing with you, so here you are. Feel free to complete, correct or anything you want! 🐧


Firstly, you need to know that everything is considered a file in Linux. If it's not a file, then it's a running process.

I. Categories of files

  1. Regular Files: These files contain binary or ASCII data and are used for storing documents, images, audio, video, and other types of data.
  2. Directory Files: In Linux, directories are considered files because they provide a storage space for other files and folders.
  3. Device Files: These files are specialized and are used to communicate with device drivers, which enable the use of hardware devices on the system, including mice, keyboards, USB devices, hard drives, and others. Device files can be found in the /dev directory.

II. Linux Directory Structure Diagram

Linux Directory Structure Diagram

III. Signification of these directories

  • /: the root directory, the uppermost directory in Linux. It contains all directories, sub-dir and files on the Linux System.
  • /boot: one of the most vital directories in Linux. It contains Linux boot files, such as the kernel.
  • /etc: It contains system configuration files for all the services, scripts, and third-party applications that are installed on the system.
  • /home: It contains a user’s personal folders and files. On a graphical Linux system, the home directory, by default, contains folders such as Desktop, Documents, Downloads, Pictures, Videos, and Public.
  • /root: Is the home directory for the root user, same as /home/user but for the superuser.
  • /opt: It is reserved for add-on packages and third-party software applications that are not included by default in the system’s official repositories, ie. Discord.
  • /dev: It contains device files or special files for devices that are attached to the system such as the hard drive, keyboard, and mouse, ...
  • /var: It stores system-generated variable files, which include log files, caches, and so on.
  • /bin: It contains user binaries, executable programs, and common system commands that are used by all users in the system. These include ls, pwd, cat, etc.
  • /sbin: It contains executable files, utilities, and system commands that are reserved for the root user or a user with root privileges. Such commands include halt, reboot, etc.
  • /usr: It contains system-wide read-only files. These include libraries, user binaries and their documentation, programs, and system utilities.
  • /proc: It is a virtual or pseudo filesystem that contains vital information about running processes.
  • /mnt: It is used as a temporary mount point for mounting storage devices such as Hard disk drives, USB drives, and CDROMs.
  • /sys: It is a virtual file system that contains a set of virtual files that provide an interface to the Linux kernel.
  • /media: It is where the system mounts removable media such as USB drives.
  • /run: IT is a temporary filesystem that contains volatile runtime data.
  • /tmp: IT is a directory that stores temporary files and many programs use this directory to create lock files and keep the temporary storage of data.
  • /lib: It stores all the essential standard libraries required by user binaries in the /bin directory.
  • /lost+found: It is useful for recovering files that may be broken due to unexpected shut-down.
  • /srv: It is the service directory and is abbreviated as ‘srv‘. This directory contains server-specific and service-related files.

Et voilà, this first article is already over but stay with me, another is on the road! See you soon! 🐧