BUSYBOX(1)

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:

        arp, arping, bbconfig, dnsdomainname, ether-wake, hostname,
        ifconfig, inetd, nc, netstat, nslookup, ping, ping6, route, telnet,
        telnetd, traceroute, traceroute6, vconfig

COMMAND DESCRIPTIONS

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

    Manipulate ARP cache

    Options:

            -a              Display (all) hosts
            -s              Set new ARP entry
            -d              Delete a specified entry
            -v              Verbose
            -n              Don't resolve names
            -i IF           Network interface
            -D              Read <hwaddr> from given device
            -A,-p AF        Protocol family
            -H HWTYPE       Hardware address type

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

    Send ARP requests/replies

    Options:

            -f              Quit on first ARP reply
            -q              Quiet
            -b              Keep broadcasting, don't go unicast
            -D              Duplicated address detection mode
            -U              Unsolicited ARP mode, update your neighbors
            -A              ARP answer mode, update your neighbors
            -c N            Stop after sending N ARP requests
            -w TIMEOUT      Time to wait for ARP reply, seconds
            -I IFACE        Interface to use (default eth0)
            -s SRC_IP       Sender IP address
            DST_IP          Target IP address

bbconfig
    bbconfig

    Print the config file used by busybox build

ether-wake
    ether-wake [-b] [-i iface] [-p aa:bb:cc:dd[:ee:ff]] MAC

    Send a magic packet to wake up sleeping machines. MAC must be a station address (00:11:22:33:44:55) or a hostname with a known 'ethers' entry.

    Options:

            -b              Send wake-up packet to the broadcast address
            -i iface        Interface to use (default eth0)
            -p pass         Append four or six byte password PW to the packet

hostname
    hostname [OPTIONS] [HOSTNAME | -F FILE]

    Get or set hostname or DNS domain name

    Options:

            -s      Short
            -i      Addresses for the hostname
            -d      DNS domain name
            -f      Fully qualified domain name
            -F FILE Use FILE's content as hostname

ifconfig
    ifconfig [-a] interface [address]

    Configure a network interface

    Options:

            [add ADDRESS[/PREFIXLEN]]
            [del ADDRESS[/PREFIXLEN]]
            [[-]broadcast [ADDRESS]] [[-]pointopoint [ADDRESS]]
            [netmask ADDRESS] [dstaddr ADDRESS]
            [outfill NN] [keepalive NN]
            [hw ether|infiniband ADDRESS] [metric NN] [mtu NN]
            [[-]trailers] [[-]arp] [[-]allmulti]
            [multicast] [[-]promisc] [txqueuelen NN] [[-]dynamic]
            [mem_start NN] [io_addr NN] [irq NN]
            [up|down] ...

inetd
    inetd [-fe] [-q N] [-R N] [CONFFILE]

    Listen for network connections and launch programs

    Options:

            -f      Run in foreground
            -e      Log to stderr
            -q N    Socket listen queue (default: 128)
            -R N    Pause services after N connects/min
                    (default: 0 - disabled)

nc  nc [OPTIONS] HOST PORT - connect nc [OPTIONS] -l -p PORT [HOST] [PORT] - listen

    Options:

            -e PROG Run PROG after connect (must be last)
            -l      Listen mode, for inbound connects
            -p PORT Local port
            -s ADDR Local address
            -w SEC  Timeout for connects and final net reads
            -i SEC  Delay interval for lines sent
            -n      Don't do DNS resolution
            -u      UDP mode
            -v      Verbose
            -o FILE Hex dump traffic
            -z      Zero-I/O mode (scanning)

netstat
    netstat [-ral] [-tuwx] [-enWp]

    Display networking information

    Options:

            -r      Routing table
            -a      All sockets
            -l      Listening sockets
                    Else: connected sockets
            -t      TCP sockets
            -u      UDP sockets
            -w      Raw sockets
            -x      Unix sockets
                    Else: all socket types
            -e      Other/more information
            -n      Don't resolve names
            -W      Wide display
            -p      Show PID/program name for sockets

nslookup
    nslookup [HOST] [SERVER]

    Query the nameserver for the IP address of the given HOST optionally using a specified DNS server

ping
    ping [OPTIONS] HOST

    Send ICMP ECHO_REQUEST packets to network hosts

    Options:

            -4,-6           Force IP or IPv6 name resolution
            -c CNT          Send only CNT pings
            -s SIZE         Send SIZE data bytes in packets (default:56)
            -I IFACE/IP     Use interface or IP address as source
            -W SEC          Seconds to wait for the first response (default:10)
                            (after all -c CNT packets are sent)
            -w SEC          Seconds until ping exits (default:infinite)
                            (can exit earlier with -c CNT)
            -q              Quiet, only displays output at start
                            and when finished

ping6
    ping6 [OPTIONS] HOST

    Send ICMP ECHO_REQUEST packets to network hosts

    Options:

            -c CNT          Send only CNT pings
            -s SIZE         Send SIZE data bytes in packets (default:56)
            -I IFACE/IP     Use interface or IP address as source
            -q              Quiet, only displays output at start
                            and when finished

route
    route [{add|del|delete}]

    Edit kernel routing tables

    Options:

            -n      Don't resolve names
            -e      Display other/more information
            -A inet{6}      Select address family

telnet
    telnet [-a] [-l USER] HOST [PORT]

    Connect to telnet server

    Options:

            -a      Automatic login with $USER variable
            -l USER Automatic login as USER

telnetd
    telnetd [OPTIONS]

    Handle incoming telnet connections

    Options:

            -l LOGIN        Exec LOGIN on connect
            -f ISSUE_FILE   Display ISSUE_FILE instead of /etc/issue
            -K              Close connection as soon as login exits
                            (normally wait until all programs close slave pty)
            -p PORT         Port to listen on
            -b ADDR[:PORT]  Address to bind to
            -F              Run in foreground
            -i              Inetd mode
            -w SEC          Inetd 'wait' mode, linger time SEC
            -S              Log to syslog (implied by -i or without -F and -w)

traceroute
    traceroute [-46FIldnrv] [-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]

    Trace the route to HOST

    Options:

            -4,-6   Force IP or IPv6 name resolution
            -F      Set the don't fragment bit
            -I      Use ICMP ECHO instead of UDP datagrams
            -l      Display the TTL value of the returned packet
            -d      Set SO_DEBUG options to socket
            -n      Print numeric addresses
            -r      Bypass routing tables, send directly to HOST
            -v      Verbose
            -m      Max time-to-live (max number of hops)
            -p      Base UDP port number used in probes
                    (default 33434)
            -q      Number of probes per TTL (default 3)
            -s      IP address to use as the source address
            -t      Type-of-service in probe packets (default 0)
            -w      Time in seconds to wait for a response (default 3)
            -g      Loose source route gateway (8 max)

traceroute6
    traceroute6 [-dnrv] [-m MAXTTL] [-p PORT] [-q PROBES]
        [-s SRC_IP] [-t TOS] [-w WAIT_SEC] [-i IFACE]
        HOST [BYTES]

    Trace the route to HOST

    Options:

            -d      Set SO_DEBUG options to socket
            -n      Print numeric addresses
            -r      Bypass routing tables, send directly to HOST
            -v      Verbose
            -m      Max time-to-live (max number of hops)
            -p      Base UDP port number used in probes
                    (default is 33434)
            -q      Number of probes per TTL (default 3)
            -s      IP address to use as the source address
            -t      Type-of-service in probe packets (default 0)
            -w      Time in seconds to wait for a response (default 3)

vconfig
    vconfig COMMAND [OPTIONS]

    Create and remove virtual ethernet devices

    Options:

            add             [interface-name] [vlan_id]
            rem             [vlan-name]
            set_flag        [interface-name] [flag-num] [0 | 1]
            set_egress_map  [vlan-name] [skb_priority] [vlan_qos]
            set_ingress_map [vlan-name] [skb_priority] [vlan_qos]
            set_name_type   [name-type]

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)