The simple difference between the root directory under linux and the /bin, /sbin, /usr/sbin, /usr/bin directories

Insert picture description here

1

The top of the Linux file system is /, we call / the root of Linux. That is, the file system of the Linux operating system. The entrance of the Linux file system is /, and all directories, files, and devices are under /. / is the organizer of the Linux file system and the top leader.

2. /bin Binary command directory for all users

Contains binary executable files.
In single-user mode, the common Linux commands you need to use are located in this directory. Commands used by all users of the system are located here.
For example: ps, ls, ping, grep, cp

3. /sbin directory-binary command directory for system management

Similar to /bin, the linux commands in this directory are usually used by system administrators to maintain the system. Example: iptables, reboot, fdisk, ifconfig, swapon commands

4. /etc-configuration file directory

The default path of the configuration file of the binary installation package and the directory where the service startup command is stored

5. /dev-device file directory

Example: sound card, disk, CD-ROM, etc. On Linux systems, any devices and peripherals are stored in this directory in the form of files. Just by accessing a certain file in this directory, it is equivalent to accessing a certain device. The more important files are /dev/null, /dev/zero, /dev/tty, /dev/lp*, /dev/hd*, /dev/sd*, etc.

6. /proc-process information and kernel information directory

This directory itself is a virtual filesystem. The data it stores are all in memory, such as system core, process information, peripheral device status, network status, and so on. Because the data in this directory is in the memory (memory), it does not occupy any hard disk space. More important files (directories) such as: /proc/cpuinfo, /proc/dma, /proc/interrupts, /proc/ioports, /proc/net/*, etc.

7. /var-Variable file directory

var stands for variable file.
If /usr is a directory that will occupy a larger hard disk capacity during installation, then /var is a directory that will gradually occupy the hard disk capacity after the system is running. Because the /var directory is mainly for files that change regularly, including caches, log files, and files generated by certain software operations, including program files (lock file, run file), or such as MySQL database Files and so on.

8. /tmp-temporary file directory

Contains temporary files created by the system and users.
When the system restarts, all files in this directory will be deleted.

9. /usr-(Unix Software Resource) the directory where Unix operating system software resources are placed

All system default software will be placed under /usr, including binary files, library files, documentation and source code of secondary programs.
/usr/local contains user programs installed from source. For example, when you install Apache from source, it will be in /usr/local/apache2. (The difference from /sbin and /bin is not necessary)
This is a virtual file system, and system resources exist in the form of text information. For example: /proc/uptime

10. /home-home directory of ordinary users

All ordinary users use the home directory to store their personal files.
For example: /home/john, /home/nikita

11. /root-root user home directory

12. /boot-Bootloader file directory

Contains files related to the bootloader.
The initrd, vmlinux, and grub files of the kernel are located under /boot.
For example: initrd.img-2.6.32-24-generic, vmlinuz-2.6.32-24-generic

13. /lib-system library

Dynamic library and module files for storing programs

14. /opt-optional additional application installation directory

opt stands for optional.
Contains additional applications from individual vendors.
Additional applications should be installed in a subdirectory of /opt/ or /opt/.

14. /mnt-mount directory

System administrators can mount other temporary file systems.

15. /media-removable media equipment

Temporary directory for mounting removable devices.
For example, /media/cdrom for mounting CD-ROM, /media/floppy for mounting floppy disk drive;

16. /srv-service data directory

 
 
 
 

/ bin, / sbin, / usr / sbin, / usr / bin

These directories are used to store commands. First, distinguish between /sbin and /bin:

  1. From the point of view of command functions, the commands under /sbin are basic system commands, such as shutdown and reboot, which are used to start the system and repair the system. /bin stores some common basic commands, such as ls, chmod, etc. These commands are in Linux It is often used in configuration file scripts in the system.
  2. From the perspective of user rights, the commands in the /sbin directory can usually only be run by the administrator, and the commands in /bin can be used by both administrators and general users.
  3. From the perspective of runtime, /sbin and /bin can be used before mounting other file systems.

The difference between /usr/bin, /usr/sbin and /sbin /bin is:

  1. The /bin and /sbin directories are mounted to the root file system after the system is started, so the /sbin, /bin directories must be in the same partition as the root file system;
    /usr/bin, usr/sbin can be different from the root file system One partition.
  2. /usr/sbin stores some non-essential system commands; /usr/bin stores some user commands, such as led (controlling LED lights).
     

 
 
 
Insert picture description here

Guess you like

Origin blog.csdn.net/yuiLan0/article/details/107971359