从busybox的应用场景及有限命令来说,它在嵌入式设备应用中确实实现了这一目的,小而强大。
然而如果你将busybox放在centos或其它最小化安装的linux发行版中使用,然后这些命令在这些linux系统都已经直接或以另外的方式提供了,甚至是更新的方案。
请注意busybox的应用领域。
关于软链接到同一个busybox,可以执行不同命令的解释
[root@centos76 busybox]# ls -alh total 1.9M [root@centos76 busybox]# ls -alh total 1.9M drwxr-xr-x 2 root root 96 Feb 10 11:26 . drwxr-xr-x. 15 root root 4.0K Feb 10 10:35 .. -rwxr-xr-x 1 root root 957K Feb 10 10:37 busybox lrwxrwxrwx 1 root root 7 Feb 10 10:57 ls -> busybox lrwxrwxrwx 1 root root 8 Feb 10 11:26 qq -> test.txt -rwxr-xr-x 1 root root 157 Feb 10 11:17 test.txt lrwxrwxrwx 1 root root 8 Feb 10 11:11 uname -> test.txt lrwxrwxrwx 1 root root 8 Feb 10 11:05 wc -> test.txt [root@centos76 busybox]# ln -s test.txt qq [root@centos76 busybox]# qq -V bash: qq: command not found [root@centos76 busybox]# ./qq -V ip utility, iproute2-ss170501 [root@centos76 busybox]# ./qq a s ens33 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:0c:29:da:2c:fe brd ff:ff:ff:ff:ff:ff inet 100.64.88.148/24 brd 100.64.88.255 scope global noprefixroute dynamic ens33 valid_lft 1355sec preferred_lft 1355sec inet6 fe80::ef8a:309d:b087:4e9e/64 scope link noprefixroute valid_lft forever preferred_lft forever [root@centos76 busybox]#
#!/bin/bash if [ "$(basename $0)" = 'wc' ]; then ls fi if [ "$(basename $0)" = 'top' ]; then free -m fi if [ "$(basename $0)" = 'qq' ]; then ip $@ fi
#iptables ip6tables 也是这样的,实际上是链接到了 xtables-multi [root@centos76 busybox]# ls /usr/sbin/iptables -alh lrwxrwxrwx. 1 root root 13 Oct 23 09:24 /usr/sbin/iptables -> xtables-multi
busybox命令[截至25 October 2019 – BusyBox 1.31.1 (stable)]busybox
busybox 官方编译 https://www.busybox.net/downloads/binaries/
https://www.busybox.net/downloads/binaries/1.31.0-i686-uclibc/busybox 是完整的编译包
[root]# chmod +x ./busybox [root]# ./busybox BusyBox v1.31.0 (2019-06-10 15:13:14 CEST) multi-call binary. BusyBox is copyrighted by many authors between 1998-2015. Licensed under GPLv2. See source distribution for detailed copyright notices. Usage: busybox [function [arguments]...] or: busybox --list[-full] or: busybox --show SCRIPT or: busybox --install [-s] [DIR] or: function [arguments]... BusyBox is a multi-call binary that combines many common Unix utilities into a single executable. Most people will create a link to busybox for each function they wish to use and BusyBox will act like whatever it was invoked as. Currently defined functions: [, [[, acpid, add-shell, addgroup, adduser, adjtimex, ar, arch, arp, arping, ash, awk, base64, basename, bc, blkdiscard, blkid, blockdev, bootchartd, brctl, bunzip2, bzcat, bzip2, cal, cat, chat, chattr, chgrp, chmod, chown, chpasswd, chpst, chroot, chrt, chvt, cksum, clear, cmp, comm, conspy, cp, cpio, crond, crontab, cryptpw, cttyhack, cut, date, dc, dd, deallocvt, delgroup, deluser, depmod, devmem, df, dhcprelay, diff, dirname, dmesg, dnsd, dnsdomainname, dos2unix, dpkg, dpkg-deb, du, dumpkmap, dumpleases, echo, ed, egrep, eject, env, envdir, envuidgid, expand, expr, factor, fakeidentd, false, fatattr, fbset, fbsplash, fdflush, fdformat, fdisk, fgconsole, fgrep, find, findfs, flash_eraseall, flash_lock, flash_unlock, flashcp, flock, fold, free, freeramdisk, fsck, fsck.minix, fsfreeze, fstrim, fsync, ftpd, ftpget, ftpput, fuser, getopt, getty, grep, groups, gunzip, gzip, halt, hd, hdparm, head, hexdump, hexedit, hostid, hostname, httpd, hush, hwclock, i2cdetect, i2cdump, i2cget, i2cset, i2ctransfer, id, ifconfig, ifenslave, ifplugd, inetd, init, inotifyd, insmod, install, ionice, iostat, ip, ipaddr, ipcalc, ipcrm, ipcs, iplink, ipneigh, iproute, iprule, iptunnel, kbd_mode, kill, killall, killall5, klogd, last, less, link, linux32, linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, losetup, lpd, lpq, lpr, ls, lsattr, lsmod, lsof, lspci, lsscsi, lsusb, lzcat, lzma, lzop, lzopcat, makedevs, makemime, man, md5sum, mdev, mesg, microcom, mkdir, mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.minix, mkfs.vfat, mknod, mkpasswd, mkswap, mktemp, modinfo, modprobe, more, mount, mountpoint, mpstat, mt, mv, nameif, nbd-client, nc, netstat, nice, nl, nmeter, nohup, nologin, nproc, ntpd, nuke, od, openvt, partprobe, passwd, paste, patch, pgrep, pidof, ping, ping6, pipe_progress, pivot_root, pkill, pmap, popmaildir, poweroff, powertop, printenv, printf, ps, pscan, pstree, pwd, pwdx, raidautorun, rdate, rdev, readlink, readprofile, realpath, reboot, reformime, remove-shell, renice, reset, resize, resume, rev, rm, rmdir, rmmod, route, rpm, rpm2cpio, rtcwake, run-init, run-parts, runlevel, runsv, runsvdir, rx, script, scriptreplay, sed, sendmail, seq, setarch, setconsole, setfattr, setfont, setkeycodes, setlogcons, setpriv, setserial, setsid, setuidgid, sh, sha1sum, sha256sum, sha3sum, sha512sum, showkey, shred, shuf, slattach, sleep, smemcap, softlimit, sort, split, ssl_client, start-stop-daemon, stat, strings, stty, su, sulogin, sum, sv, svc, svlogd, svok, swapoff, swapon, switch_root, sync, sysctl, syslogd, tac, tail, tar, taskset, tc, tcpsvd, tee, telnet, telnetd, test, tftp, tftpd, time, timeout, top, touch, tr, traceroute, traceroute6, true, truncate, ts, tty, ttysize, tunctl, tune2fs, ubiattach, ubidetach, ubimkvol, ubirename, ubirmvol, ubirsvol, ubiupdatevol, udhcpc, udhcpd, udpsvd, uevent, umount, uname, uncompress, unexpand, uniq, unix2dos, unlink, unlzma, unlzop, unxz, unzip, uptime, users, usleep, uudecode, uuencode, vconfig, vi, vlock, volname, w, wall, watch, watchdog, wc, wget, which, who, whoami, whois, xargs, xxd, xz, xzcat, yes, zcat, zcip