GNU/Linux Directory Structure

This is a summary of GNU/Linux filesystem. For a longer version of documentation you can refer to https://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/c23.html The root of GNU/Linux filesystem is / directory. In this directory there are many directories or folders with files for various purposes. /bin contains the most essential binaries of the system. /boot contains the kernel and boot loader configuration. GRUB(GRand Unified Bootloader) lies on MBR(master boot record) of the hard disk. /dev contains the list of all devices. /etc contains the configuration files for various programs running in the GNU/Linux operating system. /home is used as home directory for most of the users. For example, my home directory is /home/shiv on my computer. However, a system administrator can configure home directories to belong to elsewhere in the system as well. /media, /mnt, /cdrom are used to mount storage devices on them. Mounting is a process by which a block(storage) devices is mapped to a directory of the system much like C:, D: etc of Windows. /proc contains the proc filesystem which contains the information of all running processes. /opt is the directory where other software can be installed or get installed. Some third-party software choose to install themselves in /opt directory. /usr is a very important directory. /usr/bin is the folder where most binaries are installed. /usr/lib contains the libraries. On 32-bit systems it contains 32-bit libraries and on 64-bit systems it contains 64-bit libraries. Now most of systems are 64-bit so we will focus on 64-bit systems only. /usr/lib32 contains 32-bit libraries on 64-bit systems. /usr/share contains various stuff like documentation in /usr/share/doc. Usually /usr/share contains architecture-indpendent data. /usr/include contains include files of C and C++ programming languages. /usr/man contains manual pages of programs and various other stuff. /usr/local is empty to start with but is default prefix for any program which is installed from source code locally. /usr/info contains the info documents for programs. There are other directories in /usr of some interest which you can read in the link given above. /root is the home directory of root. root is superuser or default administrator of GNU/Linux or Unix systems. No restrictions apply on a root user. /sbin and /usr/sbin contain the programs to be executed by the superuser root. /var contains many subdirectories like /var/log contains log from many system programs. /var/run contains runtime information like sockets and pids from programs. /var/lib contains downloaded packages by package managers apt, yum etc and database files from databases like MySQL and PostgreSQL. /tmp contains temporary filesystem. It may be on disk or memory. If /tmp is formatted using tmpfs then it is in memory.

With this we come to an end of summary of most important filesystem. Now we will explore useful command in next blog onward.

Leave a comment

Your email address will not be published. Required fields are marked *