Linux directory structure and details
Linux common directory structure of Centos/Ubuntu
Use of directory’s
- /bin
1. contains user(Essential) command binaries (executable file)
2. Examples: /bin/top,/bin/mv,/bin/cut,/bin/cp,/bin/rename,/bin/mkdir,etc…
- /boot
1. contains boot related file
2. Examples: grup, boot loader,kernel
- /dev
1. contains internal attached device details
2. Examples: /dev/sda,/dev/sdb,/dev/sdc,/dev/cdrom
- /etc
1. contains configuration related files
2. Examples: httpd.conf,hosts,reslov.conf,smb.conf,etc….
- /home
1. contains all users home directories
2. Examples: /home/secureethics,/home/bala
- /lib
1. contains 32 bit Libraries for the binaries
- /lib64
1. contains 64 bit Libraries for the binaries
- /media
1. Used for mount point of removable media
2. Examples: CD-ROM, Pendrive
- /mnt
1. Used for temporary mounting point
2. Example: NFS,SMB,etc
- /opt
1. Used for third party application installations
- /proc –
1. contains running process information
2. Examples: /proc/meminfo,/proc/mdstat,/proc/cpuinfo,etc…
- /root –
1. root user(super user) home directory
2. Examples: /root/
- /run
1. used for stored the run time application/service files(It will store file temporary )
- /sbin
1. contains system command binaries (executable file)
2. Examples: /sbin/service,/sbin/sshd,/sbin/smbd.
- /srv
1. Contains server specific services related data.
2. Example: /srv/cvs
- /sys
1.contains device drivers,firmware
2. Examples: /sys/drivers,/sys/firmware,/sys/bus
- /var
1. var stands for variable files.
2. Content of the files that are expected to grow can be found under this directory.
3. This includes — system log files (/var/log); packages and database files (/var/lib); emails (/var/mail); print queues (/var/spool); lock files (/var/lock); temp files needed across reboots (/var/tmp);
- /tmp
1. Directory that contains temporary files created by system and users.
2. Files under this directory are deleted when system is rebooted.
- /usr
1. Contains binaries, libraries, documentation, and source-code for second level programs.
2. /usr/bin contains binary files for user programs. If you can’t find a user binary under /bin, look under /usr/bin. For example: at, awk, cc, less, scp
3. /usr/sbin contains binary files for system administrators. If you can’t find a system binary under /sbin, look under /usr/sbin. For example: atd, cron, 3. sshd, useradd, userdel
4. /usr/lib contains libraries for /usr/bin and /usr/sbin
5. /usr/local contains users programs that you install from source. For example, when you install apache from source, it goes under /usr/local/apache2