Directory Sturucture of Linux


Hello Readers,
This blog was supposed to be on Web Development but is on Directory Structure of Linux because of a user request.
Today we'll be looking deep down in the hierarchy of Linux Directories. First let's list all the directories which are present in a Linux based Operating System. Few of the directories varies from system to system which we'll not discuss like lost+found and few more. So lets look at the basic and required directories. This Hierarchy is formed under FileSystem Hierarchy Standards (F.H.S.). In total we'll discuss a total of 16 Directories which are as follows:
  • /bin
  • /boot
  • /dev
  • /etc
  • /home
  • /lib
  • /media
  • /mnt
  • /opt
  • /sbin
  • /srv
  • /tmp
  • /usr
  • /var
  • /root
  • /proc
These are the 16 directories which are present in the most important directory .i.e ' / ' which is the root directory not the one mentioned above this ' / ' directory contains all the directories mentioned above.
Now talking the directories mentioned above:-:
        
  • /bin - This directory contains all the binary files which are required for the minimal install which you can try by running the command below. It stands for binary.
    • > init 1 
  • /boot - This is an important directory in Linux as it contains all the boot related information and files like grub.conf and vmlinuz(contains Linux Kernel Executables) image and if you want to explore more about grub read the previous post which was on GRUB.
  • /dev - This directory contains all the devices attached as Linux and Unix treat everything as a directory and same goes for hardware. You can find files/folders related to different hardware’s present in the machine.
  •  /etc - It contains information about the system which is in readable format and also user specific files. This directory also contains a passwd which I think you'll like to explore on your own and also the shadow file. ***HACKING***
  • /home - It is the directory which contains all user related files like the downloads, Desktop etc in /home we have a directory named as username and multiple directories in case of multiple users.
  • /lib - It contains all the library files like libncurses etc. Libncurses include the library files which are required to configure and make the kernel code in case you want to compile kernel from source there's already a blog on it.
  • /media - It contains all the temporary mount devices like removable media.
  • /mnt - It is also used to mount devices temporarily.
    • Now you'll be thinking that what then is the difference between /mnt and /media. Both are used to mount devices temporarily but in /media the removable devices are mounted and in /mnt we can temporarily mount storage like in cases we need more SWAP memory.
  • /opt - This directory is used to install all the additional software and the add-on packages. This directory is defined and reserved for this purpose only.
  • /sbin - sbin stands for system binary, this also contains binary files but it contain system binaries that are used by system administrator or maintainer only.
  • /srv - It stands for server and contain site-specific-service data and files like http and www.
  • /tmp - As is clear from the name it contains all the temporary files and program logs are generated in this directory which are later used for debugging.
  • /usr - It contains binaries, libraries, documentation and source code for second level programs which are user specific.
    • usr/sbin contains binary files for system administrators.
  • /var - It stands for variable and contains the system logs under the var/log directory and you switch regularly between windows and linux then you may have this error in which a dailog appears saying "System Program Problem Detected" which appears continuously so to remove that use the command given below:
    • > rm -r /var/crash/*
  • /root - It is the root directory but not of the system but of the specific user and contains files like .config and dbus configrations.
  • /proc - Contains information about system processes. This is a pseudo file system and contains informations about the running processes like pid(process id) etc.
These are the directories which are necessary under F.H.S. Hope you completely understood the Directory Structure of Linux.

Next Blog will be related to Web Development or if you want something in particular then do leave a comment!

Till then,
Adios Lactores
Happy Blogging!!!

Comments

Popular posts from this blog

A Brief about RDMA, RoCE v1 vs RoCE v2 vs iWARP

Cryptocurrency & Blockchain

Repairing your Ubuntu or Linux Dist. manually