What is the filesystem in linux ~ Unix and Linux Filesystem in detail Hierarchy system

Unix and Linux Filesystem hierarchy system


Linux uses single rooted, inverted tree like file system hierarchy

Have you wondered why certain programs are located under /home, /bin, or /sbin, or /usr/bin, or /usr/sbin?

For example, less command is located under /usr/bin directory. Why not /bin, or /sbin, or /usr/sbin? What is the different between all these directories?


In this article, let us review the Linux filesystem structures and understand the meaning of individual high-level directories.




/

This is top level directory
It is parent directory for all other directories
It is called as ROOT directory
It is represented by forward slash(/)
Like in C:\ of windows


/root

It is home directory for root user (super user)
It provide working environment for root user
C:\Documents and settings\Administrator

/home

It is home directory for other users
It provide working environment for other users (other than root)
C:\Documents and settings\username


/boot

It contains bootable files for linux
Like vmlinuz (kernel) ..  ntoskrnl
Initrd (INITial Ram Disk) and
GRUB (Grub Unified Boot Loader)… boot.ini, ntldr


/etc

It contains all configuration files
Like   /etc/passwd….  Ntoskrnl
         /etc/resolv.conf.. Preferred DNS
        /etc/dhcpd.conf…  DHCP server
C:\windows\system32\dirvers\


/usr

By default softwares are installed in /usr directory
(UNIX Sharable Resources)
C:\program files


/opt

It is optional directory for /usr
It contains third party softwares
C:\program files


/bin

It contains commands used by all  users
(Binary files)


/sbin

It contains commands used by only Super User (root)
(Super user’s binary files)


/dev

It contains device files
Like /dev/hda     ….for hard disk
/dev/cd rom …. For cd rom
Similar to device manager of windows


/proc

It contains process files
Its contents are not permanent, they keep changing
It is also called as Virtual Directory
Its file contains useful information used by os
Like      /proc/meminfo      …information of RAM/SWAP
/proc/cpuinfo   … information of CPU


/var

It is containing variable data like mails, log files


/mnt

It is default mount point for any partition
It is empty by default


/media

It contains all of removable media like CD-ROM, Pen drive


/lib

It contains library files which are used by os
It is similar to dll files of windows
Library files in Linux are SO (shared object) files





If you Like post then share and comment please And if you have any suggestion for me do comment .


Post a Comment