To understand Linux, you must know about it’s File System Structure. So, this article is aimed to provide information about Linux directory structure.
Linux Directory Structure
- /bin : Contains all binary executable programs required for booting and repairing of the system. It also contains commands required to run into single-user-mode and other basic commands like ps, ls, ping, grep, cp, less.
- /boot : Boot loader files including Linux Kernel and grub files.
- /dev : Contains all device files required for the hardware devices like cdrom, cpu, etc
- /etc : Contains Application’s configuration files, startup, shutdown, start and stop script for every individual program.
- /home : User home directory. So, every time a new user is created, a directory in the name of user is created within “/home”.
- /lib : Contains kernel modules and shared library images required to boot the system and run commands in root file system.
- /media : Mount point for removable medias. So, each time a removable media like cdrom is connected to the system it is atuomatically mounted to a temporary mount directory created under /media.
- /mnt : Temporary mount directory for mounting file systems.
- /opt : Third party application software’s for example Java
- /sbin : Binary executable programs required by System Administrator for Maintenance. Example iptables, fdisk, ifconfig, reboot etc.
- /srv : contains server specific and service related files for protocols like FTP, rsync, www etc
- /tmp : System’s Temporary Directory. It is accessible by both normal users and root hence stores temporary files for user and system.
- /usr : contains files like executable binaries, documentation, source code, libraries for second level program.
- /var : This stores all the files that vary as the system runs like logs, lock, spool, mail etc
- /root : Home directory of root user.
- /proc : Virtual file system. It doesn’t contain ‘real’ files but runtime system information (e.g. system memory, devices mounted, hardware configuration, etc)
- /lost+found : It is created during Linux installation and is useful for recovering files which may be broken due to unexpected shutdown.