Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed explanation of the differences between Linux Basics / bin,/sbin,/usr/sbin,/usr/bin catalogs

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Speaking of Linux's directory:

Some important directories in Linux:

Home directory: / root, / home/username

User executable files: / bin, / usr/bin, / usr/local/bin

System executable files: / sbin, / usr/sbin, / usr/local/sbin

Other mount points: / media, / mnt

Configuration: / etc

Temporary file: / tmp

Kernel and Bootloader:/boot

Server data: / var, / srv

System information: / proc, / sys

Shared libraries: / lib, / usr/lib, / usr/local/lib

What is the difference between them?

/ bin are some instructions of the system. Bin is the abbreviation of binary to put some necessary execution files of the system, such as cat, cp, chmod df, dmesg, gzip, kill, ls, mkdir, more, mount, rm, su, tar and so on.

/ sbin generally refers to the superuser instruction. (system binary) mainly places 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 and so on.

/ usr/bin is the running script for some of the software you install later. It mainly places some essential execution files of application software tools, such as C++, Gmail +, 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 and so on.

/ usr/sbin places some user-installed prerequisites for system management. For example: dhcpd, httpd, imap, in.*d, inetd, lpd, named, netconfig, nmbd, samba, sendmail, squid, swap, tcpd, tcpdump, etc.

A simple summary:

The / bin directory (binary) is a directory of binary execution files, which is mainly used for specific applications

/ sbin directory (system binary) is a dedicated binary code storage directory for system administrators, which is mainly used for system management

If the newly installed system, run some very normal commands such as: shutdown,fdisk, blatantly prompt: bash:command not found. that

The first thing to consider is whether these environment variables are already included in root's $PATH.

You can view PATH. If it is: PATH=$PATH:$HOME/bin, you need to add it as follows:

PATH=$PATH:$HOME/bin:/sbin:/usr/bin:/usr/sbin

(in fact, in general, path environment variable configuration will include several directories.) there is also a practical article that you can click on: if it is a necessary binary for users and administrators, it will be placed in / bin;. If it is a necessary binary for system administrators, but ordinary users will not use it at all, it will be placed on / sbin. If it is not a necessary binary file for users, it will probably be placed on / usr/bin;. If it is not a necessary tool for system administrators, such as network management commands, it will probably be placed on / usr/sbin.

When you specify the interpreter in the first line of the script, make sure whether the interpreter is installed in the / bin or / usr/bin directory.

So how do you get the environment variables of Linux?

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report