In this blog we will talk about directories in linux. Why binaries are kept /bin or /usr/sbin.
/sbin (System Binaries) : Just like /bin, /sbin also contains binary executables. But, the linux commands located under this directory are used typically by system aministrator, for system maintenance purpose. For example: iptables, reboot, fdisk, ifconfig, swapon etc.
/etc (Configuration Files) : Contains configuration files required by all programs. This also contains startup and shutdown shell scripts used to start/stop individual programs. For example: /etc/resolv.conf, /etc/logrotate.conf,etc.
/proc (Process Information) : Contains information about system process. This is a pseudo filesystem contains information about running process. For example: /proc/{pid} directory contains information about the process with that particular pid.
/var (Variable Files) : Content of the files that are expected to grow can be found under this directory. 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 (Temporary Files) : Directory that contains temporary files created by system and users. Files under this directory are deleted when system is rebooted.
/usr (User Programs) : Contains binaries, libraries, documentation, and source-code for second level programs. /usr/lib contains libraries for /usr/bin and /usr/sbin /usr/local contains users programs that you install from source. For example, when you install apache from source, it goes under /usr/local/apache2 .
/lib (System Libraries) : Contains library files that supports the binaries located under /bin and /sbin
/opt (Optional add-on Applications) : Contains add-on applications from individual vendors.
/mnt (Mount Directory) : Temporary mount directory where sysadmins can mount filesystems.
/media (Removable Media Devices) : Temporary mount directory for removable devices. For examples, /media/cdrom for CD-ROM; /media/floppy for floppy drives; /media/cdrecorder for CD writer
/srv (Service Data) : Contains server specific services related data.
https://www.geeksforgeeks.org/linux-file-hierarchy-structure/
Thank you for Reading!!