NAME

BusyBox - The Swiss Army Knife of Embedded Linux

SYNTAX

 busybox <applet> [arguments...]  # or

 <applet> [arguments...]          # if symlinked

DESCRIPTION

BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides minimalist replacements for most of the utilities you usually find in GNU coreutils, util-linux, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts.

BusyBox has been written with size-optimization and limited resources in mind. It is also extremely modular so you can easily include or exclude commands (or features) at compile time. This makes it easy to customize your embedded systems. To create a working system, just add /dev, /etc, and a Linux kernel. BusyBox provides a fairly complete POSIX environment for any small or embedded system.

BusyBox is extremely configurable. This allows you to include only the components you need, thereby reducing binary size. Run 'make config' or 'make menuconfig' to select the functionality that you wish to enable. Then run 'make' to compile BusyBox using your configuration.

After the compile has finished, you should use 'make install' to install BusyBox. This will install the 'bin/busybox' binary, in the target directory specified by CONFIG_PREFIX. CONFIG_PREFIX can be set when configuring BusyBox, or you can specify an alternative location at install time (i.e., with a command line like 'make CONFIG_PREFIX=/tmp/foo install'). If you enabled any applet installation scheme (either as symlinks or hardlinks), these will also be installed in the location pointed to by CONFIG_PREFIX.

USAGE

BusyBox is a multi-call binary. A multi-call binary is an executable program that performs the same job as more than one utility program. That means there is just a single BusyBox binary, but that single binary acts like a large number of utilities. This allows BusyBox to be smaller since all the built-in utility programs (we call them applets) can share code for many common operations.

You can also invoke BusyBox by issuing a command as an argument on the command line. For example, entering

        /bin/busybox ls

will also cause BusyBox to behave as 'ls'.

Of course, adding '/bin/busybox' into every command would be painful. So most people will invoke BusyBox using links to the BusyBox binary.

For example, entering

        ln -s /bin/busybox ls
        ./ls

will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiled into BusyBox). Generally speaking, you should never need to make all these links yourself, as the BusyBox build system will do this for you when you run the 'make install' command.

If you invoke BusyBox with no arguments, it will provide you with a list of the applets that have been compiled into your BusyBox binary.

COMMON OPTIONS

Most BusyBox applets support the --help argument to provide a terse runtime description of their behavior. If the CONFIG_FEATURE_VERBOSE_USAGE option has been enabled, more detailed usage information will also be available.

COMMANDS

Currently available applets include:

        [, [[, addgroup, adduser, ar, arp, arping, ash, awk, basename,
        bunzip2, bzcat, cat, chattr, chgrp, chmod, chown, chpasswd, chroot,
        chvt, clear, cmp, cp, cpio, cryptpw, cttyhack, cut, date, dc, dd,
        deallocvt, delgroup, deluser, depmod, devmem, df, diff, dirname,
        dmesg, dnsdomainname, du, dumpkmap, dumpleases, echo, egrep, env,
        expr, false, fatattr, fbset, fdisk, fgrep, find, flock, free, fsck,
        fstrim, ftpget, ftpput, fuser, getty, grep, groups, gunzip, gzip,
        halt, head, hexdump, hostname, hwclock, id, ifconfig, ifdown,
        ifplugd, ifup, init, insmod, iostat, ip, kill, killall, klogd, less,
        ln, loadfont, loadkmap, logger, login, logname, logread, losetup,
        ls, lsattr, lsmod, lsof, md5sum, mdev, microcom, mkdir, mke2fs,
        mkfifo, mkfs.ext2, mknod, mkpasswd, mktemp, modprobe, more, mount,
        mpstat, mv, nc, netstat, nohup, nslookup, od, openvt, passwd, patch,
        pidof, ping, ping6, pivot_root, pmap, poweroff, powertop, printenv,
        printf, ps, pstree, pwd, rdate, readlink, realpath, reboot, renice,
        reset, rfkill, rm, rmdir, rmmod, route, run-parts, sed, seq,
        setconsole, setsid, sh, sha3sum, shuf, sleep, sort,
        start-stop-daemon, stat, strings, stty, su, sulogin, switch_root,
        sync, sysctl, syslogd, tail, tar, tee, test, time, top, touch, tr,
        traceroute, true, tty, tune2fs, ubiattach, ubidetach, ubimkvol,
        ubirmvol, ubirsvol, ubiupdatevol, udhcpc, udhcpc6, udhcpd, umount,
        uname, uniq, unlink, unzip, uptime, users, usleep, vi, vlock, watch,
        wc, which, who, whoami, xargs, yes, zcat

COMMAND DESCRIPTIONS

addgroup

addgroup [-g GID] [-S] GROUP

adduser

adduser [OPTIONS] USER [GROUP]

ar

ar [-o] [-v] [-p] [-t] [-x] ARCHIVE FILES

arp

arp [-vn] [-H HWTYPE] [-i IF] -a [HOSTNAME] [-v] [-i IF] -d HOSTNAME [pub] [-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [temp] [-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [netmask MASK] pub [-v] [-H HWTYPE] [-i IF] -Ds HOSTNAME IFACE [netmask MASK] pub

arping

arping [-fqbDUA] [-c CNT] [-w TIMEOUT] [-I IFACE] [-s SRC_IP] DST_IP

ash

ash [-/+OPTIONS] [-/+o OPT]... [-c 'SCRIPT' [ARG0 [ARGS]] / FILE [ARGS]]

awk

awk [OPTIONS] [AWK_PROGRAM] [FILE]...

basename

basename FILE [SUFFIX]

bunzip2

bunzip2 [-cf] [FILE]...

bzcat

bzcat [FILE]...

cat

cat [FILE]...

chattr

chattr [-R] [-+=AacDdijsStTu] [-v VERSION] [FILE]...

chgrp

chgrp [-RhLHP]... GROUP FILE...

chmod

chmod [-R] MODE[,MODE]... FILE...

chown

chown [-RhLHP]... OWNER[<.|:>[GROUP]] FILE...

chpasswd

chpasswd [--md5|--encrypted]

chroot

chroot NEWROOT [PROG ARGS]

chvt

chvt N

clear

clear

cmp

cmp [-l] [-s] FILE1 [FILE2]

cp

cp [OPTIONS] SOURCE... DEST

cpio

cpio [-dmvu] [-F FILE] [-ti] [EXTR_FILE]...

cryptpw

cryptpw [OPTIONS] [PASSWORD] [SALT]

cttyhack

cttyhack [PROG ARGS]

cut

cut [OPTIONS] [FILE]...

date

date [OPTIONS] [+FMT] [TIME]

dc

dc EXPRESSION...

dd

dd [if=FILE] [of=FILE] [bs=N] [count=N] [skip=N] [seek=N]

deallocvt

deallocvt [N]

delgroup

delgroup GROUP

deluser

deluser USER

depmod

depmod [-n] [-b BASE] [VERSION] [MODFILES]...

devmem

devmem ADDRESS [WIDTH [VALUE]]

df

df [-PkmhT] [FILESYSTEM]...

diff

diff [-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2

dirname

dirname FILENAME

dmesg

dmesg [-c] [-n LEVEL] [-s SIZE]

du

du [-aHLdclsxhmk] [FILE]...

dumpkmap

dumpkmap > keymap

dumpleases

dumpleases [-r|-a] [-f LEASEFILE]

echo

echo [-neE] [ARG]...

env

env [-iu] [-] [name=value]... [PROG ARGS]

expr

expr EXPRESSION

false

false

fatattr

fatattr [-+rhsvda] FILE...

fbset

fbset [OPTIONS] [MODE]

fdisk

fdisk [-ul] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] DISK

find

find [-HL] [PATH]... [OPTIONS] [ACTIONS]

flock

flock [-sxun] FD|{FILE [-c] PROG ARGS}

free

free

fsck

fsck [-ANPRTV] [-C FD] [-t FSTYPE] [FS_OPTS] [BLOCKDEV]...

fstrim

fstrim [OPTIONS] MOUNTPOINT

ftpget

ftpget [OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE

ftpput

ftpput [OPTIONS] HOST [REMOTE_FILE] LOCAL_FILE

fuser

fuser [OPTIONS] FILE or PORT/PROTO

getty

getty [OPTIONS] BAUD_RATE[,BAUD_RATE]... TTY [TERMTYPE]

grep

grep [-HhnlLoqvsriwFE] [-m N] [-A/B/C N] PATTERN/-e PATTERN.../-f FILE [FILE]...

groups

groups [USER]

gunzip

gunzip [-cft] [FILE]...

gzip

gzip [-cfd] [FILE]...

halt

halt [-d DELAY] [-n] [-f]

head [OPTIONS] [FILE]...

hexdump

hexdump [-bcCdefnosvx] [FILE]...

hostname

hostname [OPTIONS] [HOSTNAME | -F FILE]

hwclock

hwclock [-r|--show] [-s|--hctosys] [-w|--systohc] [-t|--systz] [-l|--localtime] [-u|--utc] [-f|--rtc FILE]

id

id [OPTIONS] [USER]

ifconfig

ifconfig [-a] interface [address]

ifdown

ifdown [-anmvf] [-i FILE] IFACE...

ifplugd

ifplugd [OPTIONS]

ifup

ifup [-anmvf] [-i FILE] IFACE...

init

init

insmod

insmod FILE [SYMBOL=VALUE]...

iostat

iostat [-c] [-d] [-t] [-z] [-k|-m] [ALL|BLOCKDEV...] [INTERVAL [COUNT]]

ip

ip [OPTIONS] {address | route | link | tunnel | } {COMMAND}

kill

kill [-l] [-SIG] PID...

killall

killall [-l] [-q] [-SIG] PROCESS_NAME...

klogd

klogd [-c N] [-n]

less

less [-EMmNh~] [FILE]...

ln

ln [OPTIONS] TARGET... LINK|DIR

loadfont

loadfont < font

loadkmap

loadkmap < keymap

logger

logger [OPTIONS] [MESSAGE]

login

login [-p] [-h HOST] [[-f] USER]

logname

logname

logread

logread [-f]

losetup

losetup [-r] [-o OFS] {-f|LOOPDEV} FILE - associate loop devices losetup -d LOOPDEV - disassociate losetup -a - show status losetup -f - show next free loop device

ls

ls [-1AaCxdLHRFplinsehrSXvctu] [-w WIDTH] [FILE]...

lsattr

lsattr [-Radlv] [FILE]...

lsmod

lsmod

lsof

lsof

md5sum

md5sum [-c[sw]] [FILE]...

mdev

mdev [-s]

microcom

microcom [-d DELAY] [-t TIMEOUT] [-s SPEED] [-X] TTY

mkdir

mkdir [OPTIONS] DIRECTORY...

mke2fs

mke2fs [-Fn] [-b BLK_SIZE] [-i INODE_RATIO] [-I INODE_SIZE] [-m RESERVED_PERCENT] [-L LABEL] BLOCKDEV [KBYTES]

mkfifo

mkfifo [-m MODE] NAME

mkfs.ext2

mkfs.ext2 [-Fn] [-b BLK_SIZE] [-i INODE_RATIO] [-I INODE_SIZE] [-m RESERVED_PERCENT] [-L LABEL] BLOCKDEV [KBYTES]

mknod

mknod [-m MODE] NAME TYPE MAJOR MINOR

mkpasswd

mkpasswd [OPTIONS] [PASSWORD] [SALT]

mktemp

mktemp [-dt] [-p DIR] [TEMPLATE]

modprobe

modprobe [-alrqvsD] MODULE [SYMBOL=VALUE]...

more

more [FILE]...

mount

mount [OPTIONS] [-o OPTS] DEVICE NODE

mpstat

mpstat [-A] [-I SUM|CPU|ALL|SCPU] [-u] [-P num|ALL] [INTERVAL [COUNT]]

mv

mv [-fin] SOURCE DEST or: mv [-fin] SOURCE... DIRECTORY

nc

nc [IPADDR PORT]

netstat

netstat [-ral] [-tuwx] [-en]

nohup

nohup PROG ARGS

nslookup

nslookup [HOST] [SERVER]

od

od [-aBbcDdeFfHhIiLlOovXx] [FILE]

openvt

openvt [-c N] [-sw] [PROG ARGS]

passwd

passwd [OPTIONS] [USER]

patch

patch [OPTIONS] [ORIGFILE [PATCHFILE]]

pidof

pidof [NAME]...

ping

ping [OPTIONS] HOST

ping6

ping6 [OPTIONS] HOST

pivot_root

pivot_root NEW_ROOT PUT_OLD

pmap

pmap [-xq] PID

poweroff

poweroff [-d DELAY] [-n] [-f]

powertop

powertop

printenv

printenv [VARIABLE]...

printf

printf FORMAT [ARG]...

ps

ps

pstree

pstree [-p] [PID|USER]

pwd

pwd

rdate

rdate [-sp] HOST

readlink [-fnv] FILE

realpath

realpath FILE...

reboot

reboot [-d DELAY] [-n] [-f]

renice

renice {{-n INCREMENT} | PRIORITY} [[-p | -g | -u] ID...]

reset

reset

rfkill

rfkill COMMAND [INDEX|TYPE]

rm

rm [-irf] FILE...

rmdir

rmdir [OPTIONS] DIRECTORY...

rmmod

rmmod [-wfa] [MODULE]...

route

route [{add|del|delete}]

run-parts

run-parts [-a ARG]... [-u UMASK] [--reverse] [--test] [--exit-on-error] DIRECTORY

sed

sed [-inrE] [-f FILE]... [-e CMD]... [FILE]... or: sed [-inrE] CMD [FILE]...

seq

seq [-w] [-s SEP] [FIRST [INC]] LAST

setconsole

setconsole [-r] [DEVICE]

setsid

setsid PROG ARGS

sh

sh [-/+OPTIONS] [-/+o OPT]... [-c 'SCRIPT' [ARG0 [ARGS]] / FILE [ARGS]]

sha3sum

sha3sum [-c[sw]] [FILE]...

shuf

shuf [-e|-i L-H] [-n NUM] [-o FILE] [-z] [FILE|ARG...]

sleep

sleep [N]...

sort

sort [-nrugMcszbdfimSTokt] [-o FILE] [-k start[.offset][opts][,end[.offset][opts]] [-t CHAR] [FILE]...

start-stop-daemon

start-stop-daemon [OPTIONS] [-S|-K] ... [-- ARGS...]

stat

stat [OPTIONS] FILE...

strings

strings [-afo] [-n LEN] [FILE]...

stty

stty [-a|g] [-F DEVICE] [SETTING]...

su

su [OPTIONS] [-] [USER]

sulogin

sulogin [-t N] [TTY]

switch_root

switch_root [-c /dev/console] NEW_ROOT NEW_INIT [ARGS]

sync

sync

sysctl

sysctl [OPTIONS] [KEY[=VALUE]]...

syslogd

syslogd [OPTIONS]

tail

tail [OPTIONS] [FILE]...

tar

tar -[cxtZzjahvO] [-X FILE] [-T FILE] [-f TARFILE] [-C DIR] [FILE]...

tee

tee [-ai] [FILE]...

test

test EXPRESSION ]

time

time [-v] PROG ARGS

top

top [-b] [-nCOUNT] [-dSECONDS] [-m]

touch

touch [-c] [-d DATE] [-t DATE] [-r FILE] FILE...

tr

tr [-cds] STRING1 [STRING2]

traceroute

traceroute [-FIldnrv] [-f 1ST_TTL] [-m MAXTTL] [-p PORT] [-q PROBES] [-s SRC_IP] [-t TOS] [-w WAIT_SEC] [-g GATEWAY] [-i IFACE] [-z PAUSE_MSEC] HOST [BYTES]

true

true

tty

tty

tune2fs

tune2fs [-c MAX_MOUNT_COUNT] [-i DAYS] [-C MOUNT_COUNT] [-L LABEL] BLOCKDEV

ubiattach

ubiattach -m MTD_NUM [-d UBI_NUM] UBI_CTRL_DEV

ubidetach

ubidetach -d UBI_NUM UBI_CTRL_DEV

ubimkvol

ubimkvol UBI_DEVICE -N NAME [-s SIZE | -m]

ubirmvol

ubirmvol UBI_DEVICE -n VOLID

ubirsvol

ubirsvol UBI_DEVICE -n VOLID -s SIZE

ubiupdatevol

ubiupdatevol UBI_DEVICE [-t | [-s SIZE] IMG_FILE]

udhcpc

udhcpc [-fbqRB] [-a[MSEC]] [-t N] [-T SEC] [-A SEC/-n] [-i IFACE] [-s PROG] [-p PIDFILE] [-oC] [-r IP] [-V VENDOR] [-F NAME] [-x OPT:VAL]... [-O OPT]...

udhcpc6

udhcpc6 [-fbnqoR] [-i IFACE] [-r IP] [-s PROG] [-p PIDFILE] [-x OPT:VAL]... [-O OPT]...

udhcpd

udhcpd [-fS] [-I ADDR] [CONFFILE]

umount

umount [OPTIONS] FILESYSTEM|DIRECTORY

uname

uname [-amnrspvio]

uniq

uniq [-cdu][-f,s,w N] [INPUT [OUTPUT]]

unlink FILE

unzip

unzip [-lnopq] FILE[.zip] [FILE]... [-x FILE...] [-d DIR]

uptime

uptime

users

users

usleep

usleep N

vi

vi [OPTIONS] [FILE]...

vlock

vlock [-a]

watch

watch [-n SEC] [-t] PROG ARGS

wc

wc [-cmlwL] [FILE]...

which

which [COMMAND]...

who

who [-a]

whoami

whoami

xargs

xargs [OPTIONS] [PROG ARGS]

yes

yes [STRING]

zcat

zcat [FILE]...

LIBC NSS

GNU Libc (glibc) uses the Name Service Switch (NSS) to configure the behavior of the C library for the local environment, and to configure how it reads system data, such as passwords and group information. This is implemented using an /etc/nsswitch.conf configuration file, and using one or more of the /lib/libnss_* libraries. BusyBox tries to avoid using any libc calls that make use of NSS. Some applets however, such as login and su, will use libc functions that require NSS.

If you enable CONFIG_USE_BB_PWD_GRP, BusyBox will use internal functions to directly access the /etc/passwd, /etc/group, and /etc/shadow files without using NSS. This may allow you to run your system without the need for installing any of the NSS configuration files and libraries.

When used with glibc, the BusyBox 'networking' applets will similarly require that you install at least some of the glibc NSS stuff (in particular, /etc/nsswitch.conf, /lib/libnss_dns*, /lib/libnss_files*, and /lib/libresolv*).

Shameless Plug: As an alternative, one could use a C library such as uClibc. In addition to making your system significantly smaller, uClibc does not require the use of any NSS support files or libraries.

MAINTAINER

Denis Vlasenko <vda.linux@googlemail.com>

AUTHORS

The following people have contributed code to BusyBox whether they know it or not. If you have written code included in BusyBox, you should probably be listed here so you can obtain your bit of eternal glory. If you should be listed here, or the description of what you have done needs more detail, or is incorrect, please send in an update.


Emanuele Aina <emanuele.aina@tiscali.it> run-parts


Erik Andersen <andersen@codepoet.org>

    Tons of new stuff, major rewrite of most of the
    core apps, tons of new apps as noted in header files.
    Lots of tedious effort writing these boring docs that
    nobody is going to actually read.

Laurence Anderson <l.d.anderson@warwick.ac.uk>

    rpm2cpio, unzip, get_header_cpio, read_gz interface, rpm

Jeff Angielski <jeff@theptrgroup.com>

    ftpput, ftpget

Edward Betts <edward@debian.org>

    expr, hostid, logname, whoami

John Beppu <beppu@codepoet.org>

    du, nslookup, sort

Brian Candler <B.Candler@pobox.com>

    tiny-ls(ls)

Randolph Chung <tausq@debian.org>

    fbset, ping, hostname

Dave Cinege <dcinege@psychosis.com>

    more(v2), makedevs, dutmp, modularization, auto links file,
    various fixes, Linux Router Project maintenance

Jordan Crouse <jordan@cosmicpenguin.net>

    ipcalc

Magnus Damm <damm@opensource.se>

    tftp client insmod powerpc support

Larry Doolittle <ldoolitt@recycle.lbl.gov>

    pristine source directory compilation, lots of patches and fixes.

Glenn Engel <glenne@engel.org>

    httpd

Gennady Feldman <gfeldman@gena01.com>

    Sysklogd (single threaded syslogd, IPC Circular buffer support,
    logread), various fixes.

Karl M. Hegbloom <karlheg@debian.org>

    cp_mv.c, the test suite, various fixes to utility.c, &c.

Daniel Jacobowitz <dan@debian.org>

    mktemp.c

Matt Kraai <kraai@alumni.cmu.edu>

    documentation, bugfixes, test suite

Stephan Linz <linz@li-pro.net>

    ipcalc, Red Hat equivalence

John Lombardo <john@deltanet.com>

    tr

Glenn McGrath <bug1@iinet.net.au>

    Common unarchiving code and unarchiving applets, ifupdown, ftpgetput,
    nameif, sed, patch, fold, install, uudecode.
    Various bugfixes, review and apply numerous patches.

Manuel Novoa III <mjn3@codepoet.org>

    cat, head, mkfifo, mknod, rmdir, sleep, tee, tty, uniq, usleep, wc, yes,
    mesg, vconfig, make_directory, parse_mode, dirname, mode_string,
    get_last_path_component, simplify_path, and a number trivial libbb routines

    also bug fixes, partial rewrites, and size optimizations in
    ash, basename, cal, cmp, cp, df, du, echo, env, ln, logname, md5sum, mkdir,
    mv, realpath, rm, sort, tail, touch, uname, watch, arith, human_readable,
    interface, dutmp, ifconfig, route

Vladimir Oleynik <dzo@simtreas.ru>

    cmdedit; xargs(current), httpd(current);
    ports: ash, crond, fdisk, inetd, stty, traceroute, top;
    locale, various fixes
    and irreconcilable critic of everything not perfect.

Bruce Perens <bruce@pixar.com>

    Original author of BusyBox in 1995, 1996. Some of his code can
    still be found hiding here and there...

Tim Riker <Tim@Rikers.org>

    bug fixes, member of fan club

Kent Robotti <robotti@metconnect.com>

    reset, tons and tons of bug reports and patches.

Chip Rosenthal <chip@unicom.com>, <crosenth@covad.com>

    wget - Contributed by permission of Covad Communications

Pavel Roskin <proski@gnu.org>

    Lots of bugs fixes and patches.

Gyepi Sam <gyepi@praxis-sw.com>

    Remote logging feature for syslogd

Linus Torvalds <torvalds@transmeta.com>

    mkswap, fsck.minix, mkfs.minix

Mark Whitley <markw@codepoet.org>

    grep, sed, cut, xargs(previous),
    style-guide, new-applet-HOWTO, bug fixes, etc.

Charles P. Wright <cpwright@villagenet.com>

    gzip, mini-netcat(nc)

Enrique Zanardi <ezanardi@ull.es>

    tarcat (since removed), loadkmap, various fixes, Debian maintenance

Tito Ragusa <farmatito@tiscali.it>

    devfsd and size optimizations in strings, openvt and deallocvt.

Paul Fox <pgf@foxharp.boston.ma.us>

    vi editing mode for ash, various other patches/fixes

Roberto A. Foglietta <me@roberto.foglietta.name>

    port: dnsd

Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>

    misc

Mike Frysinger <vapier@gentoo.org>

    initial e2fsprogs, printenv, setarch, sum, misc

Jie Zhang <jie.zhang@analog.com>

    fixed two bugs in msh and hush (exitcode of killed processes)