Dive Deeper into the Linux File Hierarchy: Part 2 Explained

Mihir SuratwalaMihir Suratwala
3 min read

Last Blog Review

In the last blog, we learned on about the Linux File Hierarchy and the Tree like structure as how all the directories in Linux starts with the “/” (root). We looked on some important directories in the Linux and a surprise with a Interview Question at the end.

Let’s explore some more important Directories of Linux File Hierarchy System →

  • /dev → Device files

    1. It contains the device hardware files.

    2. Contains the device files.

    3. It includes terminal devices, usb or any other device attached to the machine.

    4. Example. /dev/tty1, /dev/usbmon0

  • /var → Variable file

    1. Variable data files such as log files are stored in the /var directory.

    2. File which will grow are located in this directory. This includes

      a. /var/log → System log files generated by OS and other applications.

      b. /var/lib → Contains database and packages files.

      c. /var/mail → Contains Emails.

      d. /var/temp → Contains Temporary files needed for reboot.

  • /mnt → Mount Directory

    1. It’s used to mount a file system temporarily.
  • /media → Removable Media Devices

    1. It contains subdirectories where removable media devices inserted into the computer are mounted.
  • /usr → User Binaries

    1. It contains applications and files used by user’s, as opposed to application and files used by system.
  • /etc → Configuration files

    1. It contains all configuration files of server.

    2. The core configuration files are stored in this directory. It contains the behavior of an OS or application. This directory also contains startup and shutdown program scripts that are used to start or stop individual programs.

  • /boot → Boot Loader files

    1. It contains the files needed to boot the system.

    2. Example. The grub boot loader’s files and Linux kernel’s are stored here.

  • /home → Home Directory

    1. It contains secondary user’s home directory.
  • /tmp → Temporary files

    1. Directory contains temporary files created by system and user’s.

    2. Files under this directory are deleted when system is rebooted.

  • /opt → Optimal Applications

    1. This directory is used for installing the application software from third-party vendors that are not available in the Linux distribution. Usually, the software code is the stored in the opt directory and the binary code is stored in the bin directory so that all the user’s can run that software.

Conclusion

As discussed in the last blog, we have introduced the Linux File Hierarchy System. But in the this blog we went through the important Directories which work internally in Linux that helps the user’s to use this OS.

💡
If you enjoyed this post, don't forget to share it with your friends! Have questions or thoughts? Drop a comment below – I'd love to hear your insights and continue the conversation. And make sure to subscribe to get more content straight to your inbox! Stay tuned for more tips, ideas, and inspiration. Until next time!
0
Subscribe to my newsletter

Read articles from Mihir Suratwala directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Mihir Suratwala
Mihir Suratwala

Hi, How are you !! Hope you doing good.... I got introduced to Cloud initially. As I went ahead learning what is cloud and how it works, then got to know a field which is DevOps that makes Cloud model more effective. So, as I started working & got good experience on AWS. I have been learning the DevOps tool and technologies on how to use it with the Cloud, which will give me good understanding on how Cloud and DevOps go hand in hand to deploy my applications.