An accident once again understand the difference between Linux/bin/sbin/usr/bin/usr/sbin

Source: Internet
Author: User

One: The accident process

In the company a quasi-production environment (fortunately is quasi-production) due to the company a service log level is not adjusted to error, resulting in a large number of logging to the/root directory (note that/root is separate partition under the/partition and is not very large, remember that the service log level can not directly hit the/root directory, Program services are published to a partition larger than the Linux file organization structure in variable directory such as/var. ) Direct full/directory capacity. Restarted the server and found that the server was only mounted/directory.

Second: Problem solving

According to the log prompt to find the cause of the problem, through the DF, du command to find the file, delete the log, restart the resolution. These workarounds are not the focus, but the point is why these commands can be used.

Three: Thinking after the solution

When/directories do not have free space why not mount other directories after rebooting. This is because all of the directories that the Linux text system decides are to be read from/to the Mount information in the Fstab by Initab initialization to implement directory mount. Now/directory is full and there is no space available to mount other directories.

Why you can use the DF du RM command. This is because these commands are system commands, and system commands are stored in the/bin and /sbin directories. What's the difference between the/bin and the/sbin catalogue ?

1) from the command function,/sbin commands are basic system commands, such as Shutdown,reboot, used to start the system, repair the system,/bin to store some common basic commands, such as Ls,chmod, These commands are often used in configuration file scripts in Linux systems.

2) from the point of view of user rights, the commands under the/sbin directory are usually only available to administrators, and can be used by command administrators and general users under/bin.

3) from a running time perspective, the/sbin,/bin can be used before mounting other file systems.

The/bin and/sbin directories are mounted to the root file system after the system is booted, so the/sbin,/bin directory must be in the same partition as the root file system, so you know why you can use the DF du RM commands. Because DF du RM is a/bin system command. Some other system commands cat Chown CP date DD echo .... such as

The difference between the/usr/bin,/usr/sbin and the/sbin/bin directory is that

1) The/bin,/sbin directory is mounted to the root file system after the system is booted, so the/sbin,/bin directory must be in the same partition as the root file system;

2)/usr/sbin Some of the non-essential system commands stored,/usr/bin store some user commands

3) Usr/bin/usr/sbin you can not have a partition with the root file system.

Four: An explanation of the online turn

/bin       are some of the instructions of the system. The bin for binary shorthand mainly places some of the system's necessary execution files such as: Cat, CP, CHMOD DF, DMESG, gzip, kill, LS, mkdir, more, Mount, RM, Su, tar, etc.     /sbin      is generally referred to as Superuser instructions. There are some essential programs for system management such as Cfdisk, DHCPCD, Dump, E2FSCK, Fdisk, Halt, Ifconfig, Ifup,  ifdown, Init, Insmod, Lilo, Lsmod, MKE2FS, Modprobe, Quotacheck, reboot, Rmmod,  runlevel, shutdown, etc.    /usr/bin is a running script for some of the software you install later. Some of the essential executable files for application software tools such as C + +, g++, GCC, Chdrv, diff, Dig, Du, eject, elm, free, gnome*,  gzip, htpasswd, KFM, Ktop, last, less , Locale, M4, make, man, Mcopy, NcFTP,  newaliases, nslookup passwd, quota, smb*, wget, etc. /usr/sbin  places some user-installed prerequisites for system administration such as: DHCPD, HTTPD, IMAP, IN.*D, inetd, LPD, named, Netconfig, NMBD, samba, sendmail, squid , swap, TCPD, tcpdump and so on.      if the newly installed system, run some very normal such as: shutdown,fdisk command, blatant hint: bash:command not found. The first thing to consider is whether these environment variables are already included in the root  $path.      can view PATH, if: path= $PATH: $HOME/bin needs to be added as follows: path= $PATH: $HOME/bin:/sbin:/usr/bin:/usr/sbin 

This article is from the "Slayer" blog, make sure to keep this source

An accident once again understand the difference between Linux/bin/sbin/usr/bin/usr/sbin

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.