man hier :[hierarchy] gives all this info
/boot -> boot related files, linux kernel binary, grub config etc
/etc -> [backronym “Editable Text Configuration”] [sysad related] all host specific system wide configuration files for applications , eg network manager , lightdm everything is here & startup, shutdown, start, stop shell scripts for every individual programs.
-
- /etc/bash.bashrc : Contains system defaults and aliases used by bash shell.
- /etc/profile : Bash shell defaults
- /etc/profile.d : Application script, executed after login.
- /etc/skel : Script that populates new user home directory. (by mistake you deleted local configuations in ~/*.*)
- /etc/crontab : A shell script to run specified commands on a predefined time Interval.
- /etc/init.d : Service startup Scripts.
- /etc/resolv.conf : Domain Name Servers (DNS) being used by System.
- /etc/network/interfaces for static/dhcp ip address, LAN configuration
-
- /etc/hosts : Information of Ip addresses and corresponding host names.
- /etc/hosts.allow : List of hosts allowed to access services on the local machine.
- /etc/host.deny : List of hosts denied to access services on the local machine
/etc/grub.conf: grub bootloader configuration file.(/boot/grub/grub.cfg).- /etc/modules: Configuration files for system modules.
- /etc/passwd : Contains password of system users in a shadow file, a security implementation.
- /etc/X11 : Configuration files of X-window System.
- /etc/fstab : Information of Disk Drive and their mount point. (command – blkid )
- /etc/mtab : Currently mounted blocks information. (??usecase)
- /etc/group : Information of Security Group.(usecase??)
/proc -> [Process Information] This is a pseudo filesystem(procfs) contains information about system processes/info,kernel/module exported variable values, for running process /proc/{pid}
- /proc/cpuinfo : CPU Information
- /proc/filesystems : File-system Information being used currently.
- /proc/interrupts : Information about the current interrupts being utilised currently.
- /proc/ioports : Contains all the Input/Output addresses used by devices on the server.
- /proc/meminfo : Memory Usages Information.
- /proc/modules : Currently using kernel module.
- /proc/mount : Mounted File-system Information.
- /proc/stat : Detailed Statistics of the current System.
- /proc/swaps : Swap File Information.
- /proc/kallsyms : all kernel symbols that have been loaded
- /proc/version : os , kernel version info
/var –> [Variable Files] Content of the files that are expected to grow can be found under this directory.
- system log files (/var/log/*)[sysad related]
- packages and database files (/var/lib);
- emails (/var/mail);
- print queues (/var/spool);
- lock files (/var/lock);
- temp files needed across reboots (/var/tmp);
- webserver files (/var/www)
- cache file (/var/cache)
/dev –> [Device Files] Essential device files that are needed for the system.
special file that appears in filesystem. It is an interface for the device driver.They allow software to interact with a device driver using standard input/output system calls, which simplifies many tasks and unifies user-space I/O mechanisms.
2 types of devices : char devices and block devices
terminal devices, usb etc. for eg: /dev/tty1, /dev/usbmon0
- stdin -> /proc/self/fd/0
- stdout -> /proc/self/fd/1
- stderr -> /proc/self/fd/2
psuedo devices
/dev/null– accepts and discards all input; produces no output (always returns an end-of-file indication on a read) (use this as a sink)/dev/zero– accepts and discards all input; produces a continuous stream of NUL (zero value) bytes (use this as source)/dev/full– produces a continuous stream of NUL (zero value) bytes when read, and returns a “disk full” message when written to/dev/randomand/dev/urandom– they produce a variable-length stream of pseudo-random numbers.
/sbin -> [system binaries] essential os system binaries e.g., fsck, init, route, insmod, rmmod, modinfo, modprobe
/bin -> [user binaries] command line binaries for single user mode?? like cat, cp, mkdir, su (permissions rwx, s-> secure execute for root user)
/lib* -> [system libraries] for /bin/ & /sbin/ binaries(system wide share/usr/bin?)
/usr -> Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities(libraries, docs) and applications[apt-get installs packages to /usr/bin and /usr/lib]
- /sbin -> non essential system binaries for sysads.For example: cron, sshd, useradd,
- /bin -> non essential command binaries for all users.For example: at, awk, cc, less, scp
- /lib* -> Libraries for the binaries in /usr/bin/ and /usr/sbin/.(above)
- /include -> Standard include files for c,c++(gcc) programs etc.
- /src -> kernel source code with header files
- /share ->Architecture-independent (shared) data. man files, info files etc
- /games -> some games
- /local ->Tertiary
hierarchy for local data, specific to this host.users programs that you
install from source.Typically has further subdirectories, e.g.,
bin/,lib/,share/- /bin ->(compiled binaries) openssl, etc
- /lib -> (shared libraries for binaries in /usr/local/bin)libssl.so , libopencv
- /include -> header files for the apps/pkg installed in /usr/local
- /etc -> configuration file for apps in /usr/local/bin
- /share -> man, info pages for apps/pkgs in /usr/local/
/media -> [Removable media] Temporary mount directory for removable devices.eg:/media/cdrom
/mnt -> [mount point] Temperoray mount directory, sysads can mount different filesystems here.
/sys -> [system information] Sysfs is
mounted under the /sys mount point.The sys
filesystem is the location where information about devices, drivers, and some kernel
features is exposed.
/tmp -> [temporary files] deleted on reboot. where as /var/tmp are preserved during reboot.
/opt -> [optinal ] Optional independent (stand alone) application software packages. (just like in windows c:/programfiles/) eg:/opt/google/
/run -> [Runtime info] Information about the running system since last boot, e.g., currently logged-in users and running daemons.
/srv-> [service] Site-specific data served by this system, such as data and scripts for web servers, data offered by FTP servers, and repositories for version control systems.usecase??
/root -> [root:~] root user’s home directory
/home -> [jaggi:~] Home directories for all users to store their personal files and personal settings eg: /home/jaggi
References – (pics, some text is directly copied from these sites)
https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
https://en.wikipedia.org/wiki/Device_file
Linux Directory Structure (File System Structure) Explained with Examples