What is the bin directory in linux

Mar 17, 2023 am 09:38 AM
linux bin directory

In Linux, the bin directory is a binary file directory, which contains binary executable files. It mainly places the necessary executable files of the system, such as cat, cp, chmod df, dmesg, gzip, kill, ls, mkdir, more, mount, rm, su, tar, etc. The purpose of the binary file depends on the system or application. If the software is installed by the user, the main program file of the software will be in the directory "/usr/local/bin".

What is the bin directory in linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

What is the Linux bin directory?

bin is the abbreviation of binary. The directory contains binary executable files, which are mainly used to store system essentials. Execution files, such as:
cat, cp, chmod df, dmesg, gzip, kill, ls, mkdir, more, mount, rm, su, tar, etc.

What is the bin directory in linux

Binary file

Simply put, text files are files based on character encoding. Common encodings include ASCII encoding and UNICODE Encoding and more. Binary files are files based on value encoding. You can specify what a certain value means according to the specific application (such a process can be regarded as custom encoding). As can be seen from the above, text files are basically fixed-length encoded. Based on characters, each character is fixed in the specific encoding. ASCII code is an 8-bit encoding, and UNICODE generally occupies 16 bits. Binary files can be regarded as variable-length encoding, because it is value encoding. How many bits represent a value is entirely up to you.

Explanation:

There is also a bin directory under /usr: /usr/bin, and the file paths in it are also executable files for some commands;

If the software is installed by the user, the main program file of the software will be in the directory /usr/local/bin (or the installation directory specified by the user, such as /usr/local/apache/bin) . Such as /usr/local/apache/bin).

Expand knowledge

In the Linux system, there are two important directories: bin and sbin, including /bin, /usr/bin/ and /sbin, /usr/sbin/.

  • /usr/bin:

Mainly places the necessary executable files of application tools, for example:

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.

  • /sbin:

Mainly places necessary 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/sbin:

Mainly places necessary programs for network management, such as:

dhcpd, httpd, imap, in.*d, inetd, lpd, named, netconfig, nmbd, samba, sendmail, squid, swap, tcpd, tcpdump, etc.

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

/  : this is root directory                root 用户根目录
/bin : commands in this dir are all system installed user commands    系统的一些指令
/sbin:  commands in this dir are all system installed super user commands  超级用户指令 系统管理命令,这里存放的是系统管理员使用的管理程序
/usr/bin: user commands for applications  后期安装的一些软件的运行脚本
/usr/sbin: super user commands for applications  超级用户的一些管理程序
/usr/X11R6/bin : X application user commands
/usr/X11R6/sbin: X application super user commands
Copy after login

Linux command list

Linux 命令大全
1、文件管理      
       cat              chattr              chgrp              chmod      
       chown              cksum              cmp              diff      
       diffstat              file              find              git      
       gitview              indent              cut              ln      
       less              locate              lsattr              mattrib      
       mc              mdel              mdir              mktemp      
       more              mmove              mread              mren      
       mtools              mtoolstest              mv              od      
       paste              patch              rcp              rm      
       slocate              split              tee              tmpwatch      
       touch              umask              which              cp      
       whereis              mcopy              mshowfat              rhmask      
       scp              awk              read              updatedb      
2、文档编辑      
       col              colrm              comm              csplit      
       ed              egrep              ex              fgrep      
       fmt              fold              grep              ispell      
       jed              joe              join              look      
       mtype              pico              rgrep              sed      
       sort              spell              tr              expr      
       uniq              wc              let        
3、文件传输      
       lprm              lpr              lpq              lpd      
       bye              ftp              uuto              uupick      
       uucp              uucico              tftp              ncftp      
       ftpshut              ftpwho              ftpcount        
4、磁盘管理      
       cd              df              dirs              du      
     edquota          eject          mcd          mdeltree    
     mdu          mkdir          mlabel          mmd    
     mrd          mzip          pwd          quota    
     mount          mmount          rmdir          rmt    
     stat          tree          umount          ls    
     quotacheck          quotaoff          lndir          repquota    
     quotaon          
5、磁盘维护      
       badblocks              cfdisk              dd              e2fsck      
       ext2ed              fsck              fsck.minix              fsconf      
       fdformat              hdparm              mformat              mkbootdisk      
       mkdosfs              mke2fs              mkfs.ext2              mkfs.msdos      
       mkinitrd              mkisofs              mkswap              mpartition      
       swapon              symlinks              sync              mbadblocks      
       mkfs.minix              fsck.ext2              fdisk              losetup      
       mkfs              sfdisk              swapoff        
6、网络通讯      
       apachectl              arpwatch              dip              getty      
       mingetty              uux              telnet              uulog      
       uustat              ppp-off              netconfig              nc      
       httpd              ifconfig              minicom              mesg      
       dnsconf              wall              netstat              ping      
       pppstats              samba              setserial              talk      
       traceroute              tty              newaliases              uuname      
       netconf              write              statserial              efax      
       pppsetup              tcpdump              ytalk              cu      
       smbd              testparm              smbclient              shapecfg      
7、系统管理      
       adduser              chfn              useradd              date      
       exit              finger              fwhios              sleep      
       suspend              groupdel              groupmod              halt      
       kill              last              lastb              login      
       logname              logout              ps              nice      
       procinfo              top              pstree              reboot      
       rlogin              rsh              sliplogin              screen      
       shutdown              rwho              sudo              gitps      
       swatch              tload              logrotate              uname      
       chsh              userconf              userdel              usermod      
       vlock              who              whoami              whois      
       newgrp              renice              su              skill      
       w              id              groupadd              free      
8、系统设置      
       reset              clear              alias              dircolors      
       aumix              bind              chroot              clock      
       crontab              declare              depmod              dmesg      
       enable              eval              export              pwunconv      
       grpconv              rpm              insmod              kbdconfig      
       lilo              liloconfig              lsmod              minfo      
       set              modprobe              ntsysv              mouseconfig      
       passwd              pwconv              rdate              resize      
       rmmod              grpunconv              modinfo              time      
       setup              sndconfig              setenv              setconsole      
       timeconfig              ulimit              unset              chkconfig      
       apmd              hwclock              mkkickstart              fbset      
       unalias              SVGATextMode              gpasswd        
 9、备份压缩      
       ar              bunzip2              bzip2              bzip2recover      
       gunzip              unarj              compress              cpio      
       dump              uuencode              gzexe              gzip      
       lha              restore              tar              uudecode      
       unzip              zip              zipinfo        
10、设备管理      
setleds loadkeys rdev dumpkeys
MAKEDEV poweroff

Recommended learning: Linux video tutorial

The above is the detailed content of What is the bin directory in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to use docker desktop How to use docker desktop Apr 15, 2025 am 11:45 AM

How to use Docker Desktop? Docker Desktop is a tool for running Docker containers on local machines. The steps to use include: 1. Install Docker Desktop; 2. Start Docker Desktop; 3. Create Docker image (using Dockerfile); 4. Build Docker image (using docker build); 5. Run Docker container (using docker run).

How to view the docker process How to view the docker process Apr 15, 2025 am 11:48 AM

Docker process viewing method: 1. Docker CLI command: docker ps; 2. Systemd CLI command: systemctl status docker; 3. Docker Compose CLI command: docker-compose ps; 4. Process Explorer (Windows); 5. /proc directory (Linux).

What to do if the docker image fails What to do if the docker image fails Apr 15, 2025 am 11:21 AM

Troubleshooting steps for failed Docker image build: Check Dockerfile syntax and dependency version. Check if the build context contains the required source code and dependencies. View the build log for error details. Use the --target option to build a hierarchical phase to identify failure points. Make sure to use the latest version of Docker engine. Build the image with --t [image-name]:debug mode to debug the problem. Check disk space and make sure it is sufficient. Disable SELinux to prevent interference with the build process. Ask community platforms for help, provide Dockerfiles and build log descriptions for more specific suggestions.

What computer configuration is required for vscode What computer configuration is required for vscode Apr 15, 2025 pm 09:48 PM

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

vscode cannot install extension vscode cannot install extension Apr 15, 2025 pm 07:18 PM

The reasons for the installation of VS Code extensions may be: network instability, insufficient permissions, system compatibility issues, VS Code version is too old, antivirus software or firewall interference. By checking network connections, permissions, log files, updating VS Code, disabling security software, and restarting VS Code or computers, you can gradually troubleshoot and resolve issues.

Can vscode be used for mac Can vscode be used for mac Apr 15, 2025 pm 07:36 PM

VS Code is available on Mac. It has powerful extensions, Git integration, terminal and debugger, and also offers a wealth of setup options. However, for particularly large projects or highly professional development, VS Code may have performance or functional limitations.

What is vscode What is vscode for? What is vscode What is vscode for? Apr 15, 2025 pm 06:45 PM

VS Code is the full name Visual Studio Code, which is a free and open source cross-platform code editor and development environment developed by Microsoft. It supports a wide range of programming languages ​​and provides syntax highlighting, code automatic completion, code snippets and smart prompts to improve development efficiency. Through a rich extension ecosystem, users can add extensions to specific needs and languages, such as debuggers, code formatting tools, and Git integrations. VS Code also includes an intuitive debugger that helps quickly find and resolve bugs in your code.

What is the main purpose of Linux? What is the main purpose of Linux? Apr 16, 2025 am 12:19 AM

The main uses of Linux include: 1. Server operating system, 2. Embedded system, 3. Desktop operating system, 4. Development and testing environment. Linux excels in these areas, providing stability, security and efficient development tools.

See all articles