Linux/bin,/sbin,/usr/bin,/usr/sbin directory differences

Source: Internet
Author: User
Tags imap locale nslookup dmesg

The directory of four applications that we often use under Linux is/bin,/sbin,/usr/bin,/usr/sbin. And the four stored files are generally as follows: Bin directory: bin for binary shorthand mainly put 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. /usr/bin directory:There are some essential executable files for application tools such as C + +, g++, GCC, Chdrv, diff, Dig, Du, eject, elm, free, gnome*, zip, htpasswd, KFM, Ktop, last, less, locale, M4, make, man, Mcopy, NcFTP, Newaliases, Nslookup passwd, quota, smb*, wget and so on. /sbin Directory: Mainto place some system-managed prerequisites such as: Cfdisk, DHCPCD, Dump, E2FSCK, Fdisk, Halt, Ifconfig, Ifup, Ifdown, Init, Insmod, Lilo, Lsmod, MKE2FS, Modprobe, Quotacheck, reboot, Rmmod, RunLevel, shutdown and so on. /uSr/sbin Directory:Some essential programs for network management such as: DHCPD, HTTPD, IMAP, in*d, inetd, LPD, named, Netconfig, NMBD, samba, sendmail, squid, swap, TCPD, tcpdump, etc.This is a user-and administrator-required binary file that will be placed in the/bin. If this is a prerequisite for the system administrator, but the generic user does not use the binaries, it will be placed in the/sbin. Relatively. If it is not a user-required binary, it will probably be placed in/usr/bin, and if it is not a necessary tool for the system administrator, it will probably be placed in/usr/sbin.

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

These directories are stored as commands.

First distinguish between the following/sbin and/bin:

From the command function, the commands under/sbin belong to basic system commands, such as Shutdown,reboot, which are used to start the system, repair the system,/bin to store some common basic commands, such as Ls,chmod, which are often used in the configuration file scripts in the Linux system.

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

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

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

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;

/usr/bin,usr/sbin can and the root file system are not in one partition.

Some non-mandatory system commands stored by/usr/sbin;/usr/bin store Some user commands, such as LEDs (which control LED lights).

Turn off a Netizen's interpretation, personally think the interpretation is in place:

/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 prerequisites 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 and so on.


/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 Place Some user-installed system-managed prerequisites 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. So

The first thing to consider is whether these environment variables are already included in Root $path.
You can view PATH, if: path= $PATH: $HOME/bin need to be added as follows:
Path= $PATH: $HOME/bin:/sbin:/usr/bin:/usr/sbin

Source: http://hi.baidu.com/dragonscreamer/item/db5e9fc4a498e2cf984aa081

Linux/bin,/sbin,/usr/bin,/usr/sbin directory differences

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: info-contact@alibabacloud.com 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.