Busybox - Lightweight Unix Tools

D

DevynCJohnson

Guest
Busybox is a useful piece of software for embedded POSIX systems. This means Busybox can run on Linux (including Android) and BSD systems. It is also a great alternative to the GNU shellutils, fileutils, etc. In general, Busybox is a light-weight form of the GNU utilities and works the same way as the various GNU and Unix commands. Busybox is a single executable file that contains multiple commands.
http://www.busybox.net/

Busybox is free and open-source under the GPL license. The source code can be obtained from Github at http://git.busybox.net/busybox/ . Developers can remove commands at compile time to make their own smaller executable. The default executable may be around two megabytes.
Code:
collier@Nacho-Linux:~$ file `which busybox`
/bin/busybox: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.24, BuildID[sha1]=a840320c89f3534a47f7cd2afa50c5a42214decd, stripped
collier@Nacho-Linux:~$ ll `which busybox`
-rwxr-xr-x 1 root root 1931720 Aug  8  2014 /bin/busybox*

Busybox is not just used on embedded systems. It may also be used on mobile or small distros including firewalls. Busybox may also be used on high-performance systems since Busybox appears to be faster in most cases. The official website lists many Linux distros that uses Busybox (http://busybox.net/products.html).

Busybox commands can be initiated in one of two ways. Users can type "/bin/busybox ls" in a command-line. Alternately, a softlink named "ls" can link to Busybox. Busybox will see that the softlink is named "ls" and run as if "/bin/busybox ls" were executed.

Busybox supports the commands list below. Keep in mind that some specialized parameters may be missing.
  • [
  • [[
  • acpid
  • addgroup
  • adduser
  • adjtimex
  • ar
  • arp
  • arping
  • ash
  • awk
  • basename
  • beep
  • blkid
  • brctl
  • bunzip2
  • bzcat
  • bzip2
  • cal
  • cat
  • catv
  • chat
  • chattr
  • chgrp
  • chmod
  • chown
  • chpasswd
  • chpst
  • chroot
  • chrt
  • chvt
  • cksum
  • clear
  • cmp
  • comm
  • cp
  • cpio
  • crond
  • crontab
  • cryptpw
  • cut
  • date
  • dc
  • dd
  • deallocvt
  • delgroup
  • deluser
  • depmod
  • devmem
  • df
  • dhcprelay
  • diff
  • dirname
  • dmesg
  • dnsd
  • dnsdomainname
  • dos2unix
  • dpkg
  • du
  • dumpkmap
  • dumpleases
  • echo
  • ed
  • egrep
  • eject
  • env
  • envdir
  • envuidgid
  • expand
  • expr
  • fakeidentd
  • false
  • fbset
  • fbsplash
  • fdflush
  • fdformat
  • fdisk
  • fgrep
  • find
  • findfs
  • flash_lock
  • flash_unlock
  • fold
  • free
  • freeramdisk
  • fsck
  • fsck.minix
  • fsync
  • ftpd
  • ftpget
  • ftpput
  • fuser
  • getopt
  • getty
  • grep
  • gunzip
  • gzip
  • hd
  • hdparm
  • head
  • hexdump
  • hostid
  • hostname
  • httpd
  • hush
  • hwclock
  • id
  • ifconfig
  • ifdown
  • ifenslave
  • ifplugd
  • ifup
  • inetd
  • init
  • inotifyd
  • insmod
  • install
  • ionice
  • ip
  • ipaddr
  • ipcalc
  • ipcrm
  • ipcs
  • iplink
  • iproute
  • iprule
  • iptunnel
  • kbd_mode
  • kill
  • killall
  • killall5
  • klogd
  • last
  • length
  • less
  • linux32
  • linux64
  • linuxrc
  • ln
  • loadfont
  • loadkmap
  • logger
  • login
  • logname
  • logread
  • losetup
  • lpd
  • lpq
  • lpr
  • ls
  • lsattr
  • lsmod
  • lzmacat
  • lzop
  • lzopcat
  • makemime
  • man
  • md5sum
  • mdev
  • mesg
  • microcom
  • mkdir
  • mkdosfs
  • mkfifo
  • mkfs.minix
  • mkfs.vfat
  • mknod
  • mkpasswd
  • mkswap
  • mktemp
  • modprobe
  • more
  • mount
  • mountpoint
  • mt
  • mv
  • nameif
  • nc
  • netstat
  • nice
  • nmeter
  • nohup
  • nslookup
  • od
  • openvt
  • passwd
  • patch
  • pgrep
  • pidof
  • ping
  • ping6
  • pipe_progress
  • pivot_root
  • pkill
  • popmaildir
  • printenv
  • printf
  • ps
  • pscan
  • pwd
  • raidautorun
  • rdate
  • rdev
  • readlink
  • readprofile
  • realpath
  • reformime
  • renice
  • reset
  • resize
  • rm
  • rmdir
  • rmmod
  • route
  • rpm
  • rpm2cpio
  • rtcwake
  • run-parts
  • runlevel
  • runsv
  • runsvdir
  • rx
  • script
  • scriptreplay
  • sed
  • sendmail
  • seq
  • setarch
  • setconsole
  • setfont
  • setkeycodes
  • setlogcons
  • setsid
  • setuidgid
  • sh
  • sha1sum
  • sha256sum
  • sha512sum
  • showkey
  • slattach
  • sleep
  • softlimit
  • sort
  • split
  • start-stop-daemon
  • stat
  • strings
  • stty
  • su
  • sulogin
  • sum
  • sv
  • svlogd
  • swapoff
  • swapon
  • switch_root
  • sync
  • sysctl
  • syslogd
  • tac
  • tail
  • tar
  • taskset
  • tcpsvd
  • tee
  • telnet
  • telnetd
  • test
  • tftp
  • tftpd
  • time
  • timeout
  • top
  • touch
  • tr
  • traceroute
  • true
  • tty
  • ttysize
  • udhcpc
  • udhcpd
  • udpsvd
  • umount
  • uname
  • uncompress
  • unexpand
  • uniq
  • unix2dos
  • unlzma
  • unlzop
  • unzip
  • uptime
  • usleep
  • uudecode
  • uuencode
  • vconfig
  • vi
  • vlock
  • volname
  • watch
  • watchdog
  • wc
  • wget
  • which
  • who
  • whoami
  • xargs
  • yes
  • zcat
  • zcip

Busybox can be installed on Android systems via the PlayStore as seen at the links listed below. However, these are not the only installers for Android.
https://play.google.com/store/apps/details?id=com.jrummy.busybox.installer&hl=en
https://play.google.com/store/apps/details?id=stericson.busybox&hl=en

Busybox has full support for shell scripts such as "sh" and "ash". Some embedded Linux developers may wish to use MicroPerl (http://www.foo.be/docs/tpj/issues/vol5_3/tpj0503-0003.html) with Busybox as opposed to Perl.

NOTE: MicroPerl comes with the source code of the regular Perl interpreter.

Toybox is a BSD-licensed alternative that may not be one-hundred percent compatible with the GNU utility alternatives.
http://www.landley.net/toybox/

Toolbox is an Android-specific alternative to Busybox. However, Toolbox does not come with as many commands and may not be entirely compatible or equivalent with the GNU utilities. Toolbox installs under /system/bin/. Like Busybox, Toolbox is also a single executable file (/system/bin/toolbox). The source code for Toolbox can be found at https://android.googlesource.com/platform/system/core/+/master/toolbox/ .

Further Reading

 

Attachments

  • slide.jpg
    slide.jpg
    30 KB · Views: 100,903


Another great article Devyn, Puppy has of course use this for init system from its birth.
 


Top