NAME BusyBox - The Swiss Army Knife of Embedded Linux SYNTAX busybox [arguments...] # or [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: [, arch, ash, awk, base64, basename, bc, blkdiscard, bzip2, cat, chgrp, chmod, chown, chroot, clear, cp, cpio, cttyhack, cut, dd, df, dirname, dmesg, du, echo, env, expr, fallocate, false, fatattr, free, fsfreeze, fstrim, fsync, getopt, grep, gzip, halt, head, hexdump, hexedit, i2ctransfer, ifconfig, init, install, ip, ipaddr, iplink, ipneigh, iproute, iprule, iptunnel, kbd_mode, kill, killall, less, link, ln, loadfont, loadkmap, losetup, ls, lsscsi, lzop, md5sum, mim, mkdir, mkfifo, mknod, mkpasswd, mktemp, mountpoint, mv, nc, netstat, nologin, nproc, nsenter, nslookup, nuke, openvt, partprobe, paste, pgrep, pidof, ping, ping6, poweroff, printf, ps, pwd, readlink, realpath, reboot, resume, rm, rmdir, route, run-init, sed, seq, setfattr, setfont, sh, sha1sum, sha256sum, sha512sum, shuf, sleep, sort, stat, strings, sync, tac, tail, tar, tcpsvd, tee, telnet, test, tftp, touch, true, truncate, ts, udhcpc, udhcpc6, umount, uname, uniq, unlink, unshare, unzip, uptime, vi, wc, wget, which, xxd, xz, yes COMMAND DESCRIPTIONS arch arch Print system architecture ash ash [-/+OPTIONS] [-/+o OPT]... [-c 'SCRIPT' [ARG0 [ARGS]] / FILE [ARGS] / -s [ARGS]] Unix shell interpreter awk awk [OPTIONS] [AWK_PROGRAM] [FILE]... -v VAR=VAL Set variable -F SEP Use SEP as field separator -f FILE Read program from FILE -e AWK_PROGRAM base64 base64 [-d] [FILE] Base64 encode or decode FILE to standard output -d Decode data basename basename FILE [SUFFIX] Strip directory path and .SUFFIX from FILE bc bc [-sqlw] FILE... Arbitrary precision calculator -q Quiet -l Load standard math library -s Be POSIX compatible -w Warn if extensions are used $BC_LINE_LENGTH changes output width blkdiscard blkdiscard [-o OFS] [-l LEN] [-s] DEVICE Discard sectors on DEVICE -o OFS Byte offset into device -l LEN Number of bytes to discard -s Perform a secure discard bzip2 bzip2 [OPTIONS] [FILE]... Compress FILEs (or stdin) with bzip2 algorithm -1..9 Compression level -d Decompress -t Test file integrity -c Write to stdout -f Force -k Keep input files cat cat [-nbvteA] [FILE]... Print FILEs to stdout -n Number output lines -b Number nonempty lines -v Show nonprinting characters as ^x or M-x -t ...and tabs as ^I -e ...and end lines with $ -A Same as -vte chgrp chgrp [-Rh]... GROUP FILE... Change the group membership of each FILE to GROUP -R Recurse -h Affect symlinks instead of symlink targets chmod chmod [-R] MODE[,MODE]... FILE... Each MODE is one or more of the letters ugoa, one of the symbols +-= and one or more of the letters rwxst -R Recurse chown chown [-Rh]... USER[:[GRP]] FILE... Change the owner and/or group of each FILE to USER and/or GRP -R Recurse -h Affect symlinks instead of symlink targets chroot chroot NEWROOT [PROG ARGS] Run PROG with root directory set to NEWROOT clear clear Clear screen cp cp [OPTIONS] SOURCE... DEST Copy SOURCE(s) to DEST -a Same as -dpR -R,-r Recurse -d,-P Preserve symlinks (default if -R) -L Follow all symlinks -H Follow symlinks on command line -p Preserve file attributes if possible -f Overwrite -i Prompt before overwrite -l,-s Create (sym)links -T Treat DEST as a normal file -u Copy only newer files cpio cpio [-dmvu] [-F FILE] [-R USER[:GRP]] [-H newc] [-tio] [-p DIR] [EXTR_FILE]... Extract (-i) or list (-t) files from a cpio archive, or take file list from stdin and create an archive (-o) or copy files (-p) Main operation mode: -t List -i Extract EXTR_FILEs (or all) -o Create (requires -H newc) -p DIR Copy files to DIR Options: -H newc Archive format -d Make leading directories -m Preserve mtime -v Verbose -u Overwrite -F FILE Input (-t,-i,-p) or output (-o) file -R USER[:GRP] Set owner of created files -L Dereference symlinks -0 Input is separated by NULs cttyhack cttyhack [PROG ARGS] Give PROG a controlling tty if possible. Example for /etc/inittab (for busybox init): ::respawn:/bin/cttyhack /bin/sh Giving controlling tty to shell running with PID 1: $ exec cttyhack sh Starting interactive shell from boot shell script: setsid cttyhack sh cut cut [OPTIONS] [FILE]... Print selected fields from each input FILE to stdout -b LIST Output only bytes from LIST -c LIST Output only characters from LIST -d CHAR Use CHAR instead of tab as the field delimiter -s Output only the lines containing delimiter -f N Print only these fields -n Ignored dd dd [if=FILE] [of=FILE] [ibs=N obs=N/bs=N] [count=N] [skip=N] [seek=N] [conv=notrunc|noerror|sync|fsync] [iflag=skip_bytes|fullblock] [oflag=seek_bytes|append] Copy a file with converting and formatting if=FILE Read from FILE instead of stdin of=FILE Write to FILE instead of stdout bs=N Read and write N bytes at a time ibs=N Read N bytes at a time obs=N Write N bytes at a time count=N Copy only N input blocks skip=N Skip N input blocks seek=N Skip N output blocks conv=notrunc Don't truncate output file conv=noerror Continue after read errors conv=sync Pad blocks with zeros conv=fsync Physically write data out before finishing conv=swab Swap every pair of bytes iflag=skip_bytes skip=N is in bytes iflag=fullblock Read full blocks oflag=seek_bytes seek=N is in bytes oflag=append Open output file in append mode status=noxfer Suppress rate output status=none Suppress all output N may be suffixed by c (1), w (2), b (512), kB (1000), k (1024), MB, M, GB, G df df [-PkmhTai] [-B SIZE] [FILESYSTEM]... Print filesystem usage statistics -P POSIX output format -k 1024-byte blocks (default) -m 1M-byte blocks -h Human readable (e.g. 1K 243M 2G) -T Print filesystem type -a Show all filesystems -i Inodes -B SIZE Blocksize dirname dirname FILENAME Strip non-directory suffix from FILENAME dmesg dmesg [-c] [-n LEVEL] [-s SIZE] Print or control the kernel ring buffer -c Clear ring buffer after printing -n LEVEL Set console logging level -s SIZE Buffer size -r Print raw message buffer du du [-aHLdclsxhmk] [FILE]... Summarize disk space used for each FILE and/or directory -a Show file sizes too -L Follow all symlinks -H Follow symlinks on command line -d N Limit output to directories (and files with -a) of depth < N -c Show grand total -l Count sizes many times if hard linked -s Display only a total for each argument -x Skip directories on different filesystems -h Sizes in human readable format (e.g., 1K 243M 2G) -m Sizes in megabytes -k Sizes in kilobytes Default unit is 512 bytes echo echo [-neE] [ARG]... Print the specified ARGs to stdout -n Suppress trailing newline -e Interpret backslash escapes (i.e., \t=tab) -E Don't interpret backslash escapes (default) env env [-iu] [-] [name=value]... [PROG ARGS] Print the current environment or run PROG after setting up the specified environment -, -i Start with an empty environment -u Remove variable from the environment expr expr EXPRESSION Print the value of EXPRESSION to stdout EXPRESSION may be: ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2 ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0 ARG1 < ARG2 1 if ARG1 is less than ARG2, else 0. Similarly: ARG1 <= ARG2 ARG1 = ARG2 ARG1 != ARG2 ARG1 >= ARG2 ARG1 > ARG2 ARG1 + ARG2 Sum of ARG1 and ARG2. Similarly: ARG1 - ARG2 ARG1 * ARG2 ARG1 / ARG2 ARG1 % ARG2 STRING : REGEXP Anchored pattern match of REGEXP in STRING match STRING REGEXP Same as STRING : REGEXP substr STRING POS LENGTH Substring of STRING, POS counted from 1 index STRING CHARS Index in STRING where any CHARS is found, or 0 length STRING Length of STRING quote TOKEN Interpret TOKEN as a string, even if it is a keyword like 'match' or an operator like '/' (EXPRESSION) Value of EXPRESSION Beware that many operators need to be escaped or quoted for shells. Comparisons are arithmetic if both ARGs are numbers, else lexicographical. Pattern matches return the string matched between \( and \) or null; if \( and \) are not used, they return the number of characters matched or 0. fallocate fallocate [-o OFS] -l LEN FILE Preallocate space for FILE -o OFS Offset of range -l LEN Length of range fatattr fatattr [-+rhsvda] FILE... Change file attributes on FAT filesystem - Clear attributes + Set attributes r Read only h Hidden s System v Volume label d Directory a Archive free free Display the amount of free and used system memory fsfreeze fsfreeze --[un]freeze MOUNTPOINT Flush and halt writes to MOUNTPOINT fstrim fstrim [OPTIONS] MOUNTPOINT -o,--offset OFFSET Offset in bytes to discard from -l,--length LEN Bytes to discard -m,--minimum MIN Minimum extent length -v,--verbose Print number of discarded bytes fsync fsync [-d] FILE... Write all buffered blocks in FILEs to disk -d Avoid syncing metadata getopt getopt [OPTIONS] [--] OPTSTRING PARAMS -a Allow long options starting with single - -l LOPT[,...] Long options to recognize -n PROGNAME The name under which errors are reported -o OPTSTRING Short options to recognize -q No error messages on unrecognized options -Q No normal output -s SHELL Set shell quoting conventions -T Version test (exits with 4) -u Don't quote output Example: O=`getopt -l bb: -- ab:c:: "$@"` || exit 1 eval set -- "$O" while true; do case "$1" in -a) echo A; shift;; -b|--bb) echo "B:'$2'"; shift 2;; -c) case "$2" in "") echo C; shift 2;; *) echo "C:'$2'"; shift 2;; esac;; --) shift; break;; *) echo Error; exit 1;; esac done grep grep [-HhnlLoqvsrRiwFE] [-m N] PATTERN/-e PATTERN.../-f FILE [FILE]... Search for PATTERN in FILEs (or stdin) -H Add 'filename:' prefix -h Do not add 'filename:' prefix -n Add 'line_no:' prefix -l Show only names of files that match -L Show only names of files that don't match -c Show only count of matching lines -o Show only the matching part of line -q Quiet. Return 0 if PATTERN is found, 1 otherwise -v Select non-matching lines -s Suppress open and read errors -r Recurse -R Recurse and dereference symlinks -i Ignore case -w Match whole words only -x Match whole lines only -F PATTERN is a literal (not regexp) -E PATTERN is an extended regexp -m N Match up to N times per file -e PTRN Pattern to match -f FILE Read pattern from file gzip gzip [-cfkdt123456789] [FILE]... Compress FILEs (or stdin) -1..9 Compression level -d Decompress -t Test file integrity -c Write to stdout -f Force -k Keep input files halt halt [-d DELAY] [-n] [-f] Halt the system -d SEC Delay interval -n Do not sync -f Force (don't go through init) head head [OPTIONS] [FILE]... Print first 10 lines of each FILE (or stdin) to stdout. With more than one FILE, precede each with a filename header. -n N[kbm] Print first N lines -n -N[kbm] Print all except N last lines -c [-]N[kbm] Print first N bytes -q Never print headers -v Always print headers N may be suffixed by k (x1024), b (x512), or m (x1024^2). hexdump hexdump [-bcCdefnosvx] [FILE]... Display FILEs (or stdin) in a user specified format -b 1-byte octal display -c 1-byte character display -d 2-byte decimal display -o 2-byte octal display -x 2-byte hex display -C hex+ASCII 16 bytes per line -v Show all (no dup folding) -e FORMAT_STR Example: '16/1 "%02x|""\n"' -f FORMAT_FILE -n LENGTH Show only first LENGTH bytes -s OFFSET Skip OFFSET bytes hexedit hexedit FILE Edit FILE in hexadecimal i2ctransfer i2ctransfer [-fay] I2CBUS {rLENGTH[@ADDR] | wLENGTH[@ADDR] DATA...}... Read/write I2C data in one transfer -f Force access to busy addresses -a Force access to non-regular addresses -y Disable interactive mode ifconfig ifconfig [-a] interface [address] Configure a network interface [add ADDRESS[/PREFIXLEN]] [del ADDRESS[/PREFIXLEN]] [[-]broadcast [ADDRESS]] [[-]pointopoint [ADDRESS]] [netmask ADDRESS] [dstaddr ADDRESS] [outfill NN] [keepalive NN] [hw ether ADDRESS] [metric NN] [mtu NN] [[-]trailers] [[-]arp] [[-]allmulti] [multicast] [[-]promisc] [txqueuelen NN] [[-]dynamic] [mem_start NN] [io_addr NN] [irq NN] [up|down] ... init init Init is the first process started during boot. It never exits. This version of init doesn't use /etc/inittab, has fixed set of processed to run. Signals: TSTP: stop respawning until CONT QUIT: re-exec another init USR1/TERM/USR2/INT: run halt/reboot/poweroff/Ctrl-Alt-Del script install install [-cdDsp] [-o USER] [-g GRP] [-m MODE] [-t DIR] [SOURCE]... DEST Copy files and set attributes -c Just copy (default) -d Create directories -D Create leading target directories -s Strip symbol table -p Preserve date -o USER Set ownership -g GRP Set group ownership -m MODE Set permissions -t DIR Install to DIR ip ip [OPTIONS] address|route|link|tunnel|neigh|rule [ARGS] OPTIONS := -f[amily] inet|inet6|link | -o[neline] ip addr add|del IFADDR dev IFACE | show|flush [dev IFACE] [to PREFIX] ip route list|flush|add|del|change|append|replace|test ROUTE ip link set IFACE [up|down] [arp on|off] [multicast on|off] [promisc on|off] [mtu NUM] [name NAME] [qlen NUM] [address MAC] [master IFACE | nomaster] ip tunnel add|change|del|show [NAME] [mode ipip|gre|sit] [remote ADDR] [local ADDR] [ttl TTL] ip neigh show|flush [to PREFIX] [dev DEV] [nud STATE] ip rule [list] | add|del SELECTOR ACTION ipaddr ipaddr add|del IFADDR dev IFACE | show|flush [dev IFACE] [to PREFIX] ipaddr add|change|replace|delete dev IFACE IFADDR IFADDR := PREFIX | ADDR peer PREFIX [broadcast ADDR|+|-] [anycast ADDR] [label STRING] [scope SCOPE] PREFIX := ADDR[/MASK] SCOPE := [host|link|global|NUMBER] ipaddr show|flush [dev IFACE] [scope SCOPE] [to PREFIX] [label PATTERN] iplink iplink set IFACE [up|down] [arp on|off] [multicast on|off] [promisc on|off] [mtu NUM] [name NAME] [qlen NUM] [address MAC] [master IFACE | nomaster] iplink add [link IFACE] IFACE [address MAC] type TYPE [ARGS] iplink delete IFACE type TYPE [ARGS] TYPE ARGS := vlan VLANARGS | vrf table NUM VLANARGS := id VLANID [protocol 802.1q|802.1ad] [reorder_hdr on|off] [gvrp on|off] [mvrp on|off] [loose_binding on|off] iplink show [IFACE] ipneigh ipneigh show|flush [to PREFIX] [dev DEV] [nud STATE] iproute iproute list|flush|add|del|change|append|replace|test ROUTE iproute list|flush SELECTOR SELECTOR := [root PREFIX] [match PREFIX] [proto RTPROTO] PREFIX := default|ADDR[/MASK] iproute get ADDR [from ADDR iif IFACE] [oif IFACE] [tos TOS] iproute add|del|change|append|replace|test ROUTE ROUTE := NODE_SPEC [INFO_SPEC] NODE_SPEC := PREFIX [table TABLE_ID] [proto RTPROTO] [scope SCOPE] [metric METRIC] INFO_SPEC := NH OPTIONS NH := [via [inet|inet6] ADDR] [dev IFACE] [src ADDR] [onlink] OPTIONS := [mtu [lock] NUM] [advmss [lock] NUM] iprule iprule [list] | add|del SELECTOR ACTION SELECTOR := [from PREFIX] [to PREFIX] [tos TOS] [fwmark FWMARK] [dev IFACE] [pref NUMBER] ACTION := [table TABLE_ID] [nat ADDR] [prohibit|reject|unreachable] [realms [SRCREALM/]DSTREALM] TABLE_ID := [local|main|default|NUMBER] iptunnel iptunnel add|change|del|show [NAME] [mode ipip|gre|sit] [remote ADDR] [local ADDR] [ttl TTL] iptunnel add|change|del|show [NAME] [mode ipip|gre|sit] [remote ADDR] [local ADDR] [[i|o]seq] [[i|o]key KEY] [[i|o]csum] [ttl TTL] [tos TOS] [[no]pmtudisc] [dev PHYS_DEV] kbd_mode kbd_mode [-a|k|s|u] [-C TTY] Report or set VT console keyboard mode -a Default (ASCII) -k Medium-raw (keycode) -s Raw (scancode) -u Unicode (utf-8) -C TTY Affect TTY kill kill [-l] [-SIG] PID... Send a signal (default: TERM) to given PIDs -l List all signal names and numbers killall killall [-l] [-q] [-SIG] PROCESS_NAME... Send a signal (default: TERM) to given processes -l List all signal names and numbers -q Don't complain if no processes were killed less less [-EFMmNSh~] [FILE]... View FILE (or stdin) one screenful at a time -E Quit once the end of a file is reached -F Quit if entire file fits on first screen -M,-m Display status line with line numbers and percentage through the file -N Prefix line number to each line -S Truncate long lines -~ Suppress ~s displayed past EOF link link FILE LINK Create hard LINK to FILE ln ln [OPTIONS] TARGET... LINK|DIR Create a link LINK or DIR/TARGET to the specified TARGET(s) -s Make symlinks instead of hardlinks -f Remove existing destinations -n Don't dereference symlinks - treat like normal file -b Make a backup of the target (if exists) before link operation -S suf Use suffix instead of ~ when making backup files -T Treat LINK as a file, not DIR -v Verbose loadfont loadfont < font Load a console font from stdin loadkmap loadkmap < keymap Load a binary keyboard translation table from stdin losetup losetup [-rP] [-o OFS] {-f|LOOPDEV} FILE: associate loop devices losetup -c LOOPDEV: reread file size losetup -d LOOPDEV: disassociate losetup -a: show status losetup -f: show next free loop device -o OFS Start OFS bytes into FILE -P Scan for partitions -r Read-only -f Show/use next free loop device ls ls [-1AaCxdLHRFplinshrSXvctu] [-w WIDTH] [FILE]... List directory contents -1 One column output -a Include entries which start with . -A Like -a, but exclude . and .. -x List by lines -d List directory entries instead of contents -L Follow symlinks -H Follow symlinks on command line -R Recurse -p Append / to dir entries -F Append indicator (one of */=@|) to entries -l Long listing format -i List inode numbers -n List numeric UIDs and GIDs instead of names -s List allocated blocks -lc List ctime -lu List atime --full-time List full date and time -h Human readable sizes (1K 243M 2G) --group-directories-first -S Sort by size -X Sort by extension -v Sort by version -t Sort by mtime -tc Sort by ctime -tu Sort by atime -r Reverse sort order -w N Format N columns wide lzop lzop [-cfUvd123456789CF] [FILE]... -1..9 Compression level -d Decompress -c Write to stdout -f Force -U Delete input files -v Verbose -F Don't store or verify checksum -C Also write checksum of compressed block md5sum md5sum [-c[sw]] [FILE]... Print or check MD5 checksums -c Check sums against list in FILEs -s Don't output anything, status code shows success -w Warn about improperly formatted checksum lines mim mim [-f FILE] [SHELL_OPTIONS] [TARGET] ... Run a script from a Makefile-like specification file -f FILE Spec file (default Mimfile) mkdir mkdir [OPTIONS] DIRECTORY... Create DIRECTORY -m MODE Mode -p No error if exists; make parent directories as needed mkfifo mkfifo [-m MODE] NAME Create named pipe -m MODE Mode (default a=rw) mknod mknod [-m MODE] NAME TYPE [MAJOR MINOR] Create a special file (block, character, or pipe) -m MODE Creation mode (default a=rw) TYPE: b Block device c or u Character device p Named pipe (MAJOR MINOR must be omitted) mkpasswd mkpasswd [OPTIONS] [PASSWORD] [SALT] Print crypt(3) hashed PASSWORD -P,--password-fd N Read password from fd N -m,--method TYPE des,md5,sha256/512 (default ) -S,--salt SALT mktemp mktemp [-dt] [-p DIR] [TEMPLATE] Create a temporary file with name based on TEMPLATE and print its name. TEMPLATE must end with XXXXXX (e.g. [/dir/]nameXXXXXX). Without TEMPLATE, -t tmp.XXXXXX is assumed. -d Make directory, not file -q Fail silently on errors -t Prepend base directory name to TEMPLATE -p DIR Use DIR as a base directory (implies -t) -u Do not create anything; print a name Base directory is: -p DIR, else $TMPDIR, else /tmp mountpoint mountpoint [-q] <[-dn] DIR | -x DEVICE> Check if the directory is a mountpoint -q Quiet -d Print major/minor device number of the filesystem -n Print device name of the filesystem -x Print major/minor device number of the blockdevice mv mv [-fin] SOURCE DEST or: mv [-fin] SOURCE... DIRECTORY Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY -f Don't prompt before overwriting -i Interactive, prompt before overwrite -n Don't overwrite an existing file nc nc [-iN] [-wN] [-l] [-p PORT] [-f FILE|IPADDR PORT] [-e PROG] Open a pipe to IP:PORT or FILE -l Listen mode, for inbound connects (use -ll with -e for persistent server) -p PORT Local port -w SEC Connect timeout -i SEC Delay interval for lines sent -f FILE Use file (ala /dev/ttyS0) instead of network -e PROG Run PROG after connect netstat netstat [-ral] [-tuwx] [-enWp] Display networking information -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 nologin nologin Politely refuse a login nproc nproc --all --ignore=N Print number of available CPUs --all Number of installed CPUs --ignore=N Exclude N CPUs nsenter nsenter [OPTIONS] [PROG [ARGS]] -t PID Target process to get namespaces from -m[FILE] Enter mount namespace -u[FILE] Enter UTS namespace (hostname etc) -i[FILE] Enter System V IPC namespace -n[FILE] Enter network namespace -p[FILE] Enter pid namespace -U[FILE] Enter user namespace -S UID Set uid in entered namespace -G GID Set gid in entered namespace --preserve-credentials Don't touch uids or gids -r[DIR] Set root directory -w[DIR] Set working directory -F Don't fork before exec'ing PROG nslookup nslookup HOST [DNS_SERVER] Query DNS about HOST nuke nuke DIR... Remove DIRs openvt openvt [-c N] [-sw] [PROG ARGS] Start PROG on a new virtual terminal -c N Use specified VT -s Switch to the VT -w Wait for PROG to exit partprobe partprobe DEVICE... Ask kernel to rescan partition table paste paste [OPTIONS] [FILE]... Paste lines from each input file, separated with tab -d LIST Use delimiters from LIST, not tab -s Serial: one file at a time pgrep pgrep [-flanovx] [-s SID|-P PPID|PATTERN] Display process(es) selected by regex PATTERN -l Show command name too -a Show command line too -f Match against entire command line -n Show the newest process only -o Show the oldest process only -v Negate the match -x Match whole name (not substring) -s Match session ID (0 for current) -P Match parent process ID pidof pidof [OPTIONS] [NAME]... List PIDs of all processes with names that match NAMEs -s Show only one PID -o PID Omit given pid Use %PPID to omit pid of pidof's parent ping ping [OPTIONS] HOST Send ICMP ECHO_REQUEST packets to network hosts -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 SECS Interval -A Ping as soon as reply is recevied -t TTL Set TTL -I IFACE/IP Source interface or IP address -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 display output at start and when finished -p HEXBYTE Pattern to use for payload ping6 ping6 [OPTIONS] HOST Send ICMP ECHO_REQUEST packets to network hosts -c CNT Send only CNT pings -s SIZE Send SIZE data bytes in packets (default 56) -i SECS Interval -A Ping as soon as reply is recevied -I IFACE/IP Source interface or IP address -q Quiet, only display output at start and when finished -p HEXBYTE Pattern to use for payload poweroff poweroff [-d DELAY] [-n] [-f] Halt and shut off power -d SEC Delay interval -n Do not sync -f Force (don't go through init) printf printf FORMAT [ARG]... Format and print ARG(s) according to FORMAT (a-la C printf) ps ps Show list of processes w Wide output l Long output pwd pwd Print the full filename of the current working directory readlink readlink [-fnv] FILE Display the value of a symlink -f Canonicalize by following all symlinks -n Don't add newline -v Verbose realpath realpath FILE... Return the absolute pathnames of given FILE reboot reboot [-d DELAY] [-n] [-f] Reboot the system -d SEC Delay interval -n Do not sync -f Force (don't go through init) resume resume BLOCKDEV [OFFSET] Restore system state from 'suspend-to-disk' data in BLOCKDEV rm rm [-irf] FILE... Remove (unlink) FILEs -i Always prompt before removing -f Never prompt -R,-r Recurse rmdir rmdir [OPTIONS] DIRECTORY... Remove DIRECTORY if it is empty -p Include parents --ignore-fail-on-non-empty route route [{add|del|delete}] Edit kernel routing tables -n Don't resolve names -e Display other/more information -A inet{6} Select address family run-init run-init [-d CAP,CAP...] [-n] [-c CONSOLE_DEV] NEW_ROOT NEW_INIT [ARGS] Free initramfs and switch to another root fs: chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /, execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint. -c DEV Reopen stdio to DEV after switch -d CAPS Drop capabilities -n Dry run sed sed [-i[SFX]] [-nrE] [-f FILE]... [-e CMD]... [FILE]... or: sed [-i[SFX]] [-nrE] CMD [FILE]... -e CMD Add CMD to sed commands to be executed -f FILE Add FILE contents to sed commands to be executed -i[SFX] Edit files in-place (otherwise sends to stdout) Optionally back files up, appending SFX -n Suppress automatic printing of pattern space -r,-E Use extended regex syntax If no -e or -f, the first non-option argument is the sed command string. Remaining arguments are input files (stdin if none). seq seq [-w] [-s SEP] [FIRST [INC]] LAST Print numbers from FIRST to LAST, in steps of INC. FIRST, INC default to 1. -w Pad to last with leading zeros -s SEP String separator setfattr setfattr [-h] -n|-x ATTR [-v VALUE] FILE... Set extended attributes -h Do not follow symlinks -x ATTR Remove attribute ATTR -n ATTR Set attribute ATTR to VALUE -v VALUE (default: empty) setfont setfont FONT [-m MAPFILE] [-C TTY] Load a console font -m MAPFILE Load console screen map -C TTY Affect TTY instead of /dev/tty sh sh [-/+OPTIONS] [-/+o OPT]... [-c 'SCRIPT' [ARG0 [ARGS]] / FILE [ARGS] / -s [ARGS]] Unix shell interpreter sha1sum sha1sum [-c[sw]] [FILE]... Print or check SHA1 checksums -c Check sums against list in FILEs -s Don't output anything, status code shows success -w Warn about improperly formatted checksum lines sha256sum sha256sum [-c[sw]] [FILE]... Print or check SHA256 checksums -c Check sums against list in FILEs -s Don't output anything, status code shows success -w Warn about improperly formatted checksum lines sha512sum sha512sum [-c[sw]] [FILE]... Print or check SHA512 checksums -c Check sums against list in FILEs -s Don't output anything, status code shows success -w Warn about improperly formatted checksum lines shuf shuf [-e|-i L-H] [-n NUM] [-o FILE] [-z] [FILE|ARG...] Randomly permute lines -e Treat ARGs as lines -i L-H Treat numbers L-H as lines -n NUM Output at most NUM lines -o FILE Write to FILE, not standard output -z End lines with zero byte, not newline sleep sleep [N]... Pause for a time equal to the total of the args given, where each arg can have an optional suffix of (s)econds, (m)inutes, (h)ours, or (d)ays sort sort [-nru] [FILE]... Sort lines of text -n Sort numbers -r Reverse sort order -s Stable (don't sort ties alphabetically) -u Suppress duplicate lines -z Lines are terminated by NUL, not newline stat stat [OPTIONS] FILE... Display file (default) or filesystem status -c FMT Use the specified format -f Display filesystem status -L Follow links -t Terse display FMT sequences for files: %a Access rights in octal %A Access rights in human readable form %b Number of blocks allocated (see %B) %B Size in bytes of each block reported by %b %d Device number in decimal %D Device number in hex %f Raw mode in hex %F File type %g Group ID %G Group name %h Number of hard links %i Inode number %n File name %N File name, with -> TARGET if symlink %o I/O block size %s Total size in bytes %t Major device type in hex %T Minor device type in hex %u User ID %U User name %x Time of last access %X Time of last access as seconds since Epoch %y Time of last modification %Y Time of last modification as seconds since Epoch %z Time of last change %Z Time of last change as seconds since Epoch FMT sequences for file systems: %a Free blocks available to non-superuser %b Total data blocks %c Total file nodes %d Free file nodes %f Free blocks %i File System ID in hex %l Maximum length of filenames %n File name %s Block size (for faster transfer) %S Fundamental block size (for block counts) %t Type in hex %T Type in human readable form strings strings [-fo] [-t o/d/x] [-n LEN] [FILE]... Display printable strings in a binary file -f Precede strings with filenames -o Precede strings with octal offsets -t o/d/x Precede strings with offsets in base 8/10/16 -n LEN At least LEN characters form a string (default 4) sync sync [-df] [FILE]... Write all buffered blocks (in FILEs) to disk -d Avoid syncing metadata -f Sync filesystems underlying FILEs tac tac [FILE]... Concatenate FILEs and print them in reverse tail tail [OPTIONS] [FILE]... Print last 10 lines of each FILE (or stdin) to stdout. With more than one FILE, precede each with a filename header. -f Print data as file grows -c [+]N[kbm] Print last N bytes -n N[kbm] Print last N lines -n +N[kbm] Start on Nth line and print the rest -q Never print headers -s SECONDS Wait SECONDS between reads with -f -v Always print headers -F Same as -f, but keep retrying N may be suffixed by k (x1024), b (x512), or m (x1024^2). tar tar c|x|t [-zJjahmvokO] [-f TARFILE] [-C DIR] [-T FILE] [-X FILE] [--exclude PATTERN]... [FILE]... Create, extract, or list files from a tar file c Create x Extract t List -f FILE Name of TARFILE ('-' for stdin/out) -C DIR Change to DIR before operation -v Verbose -O Extract to stdout -m Don't restore mtime -o Don't restore user:group -k Don't replace existing files -z (De)compress using gzip -J (De)compress using xz -j (De)compress using bzip2 -a (De)compress based on extension -h Follow symlinks -T FILE File with names to include -X FILE File with glob patterns to exclude --exclude PATTERN Glob pattern to exclude tcpsvd tcpsvd [-hEv] [-c N] [-C N[:MSG]] [-b N] [-u USER] [-l NAME] IP PORT PROG Create TCP socket, bind to IP:PORT and listen for incoming connections. Run PROG for each connection. IP PORT IP:PORT to listen on PROG ARGS Program to run -u USER[:GRP] Change to user/group after bind -c N Up to N connections simultaneously (default 30) -b N Allow backlog of approximately N TCP SYNs (default 20) -C N[:MSG] Allow only up to N connections from the same IP: new connections from this IP address are closed immediately, MSG is written to the peer before close -E Don't set up environment -h Look up peer's hostname -l NAME Local hostname (else look up local hostname in DNS) -v Verbose Environment if no -E: PROTO='TCP' TCPREMOTEADDR='ip:port' ('[ip]:port' for IPv6) TCPLOCALADDR='ip:port' TCPORIGDSTADDR='ip:port' of destination before firewall Useful for REDIRECTed-to-local connections: iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 8080 TCPCONCURRENCY=num_of_connects_from_this_ip If -h: TCPLOCALHOST='hostname' (-l NAME is used if specified) TCPREMOTEHOST='hostname' tee tee [-ai] [FILE]... Copy stdin to each FILE, and also to stdout -a Append to the given FILEs, don't overwrite -i Ignore interrupt signals (SIGINT) telnet telnet HOST [PORT] Connect to telnet server tftp tftp [OPTIONS] HOST [PORT] Transfer a file from/to tftp server -l FILE Local FILE -r FILE Remote FILE -g Get file touch touch [-c] FILE... Update the last-modified date on the given FILE[s] -c Don't create files -h Don't follow links truncate truncate [-c] -s SIZE FILE... Truncate FILEs to the given size -c Do not create files -s SIZE Truncate to SIZE ts ts [-is] [STRFTIME] udhcpc udhcpc [-fbqvRB] [-t N] [-T SEC] [-A SEC/-n] [-i IFACE] [-P PORT] [-s PROG] [-p PIDFILE] [-oC] [-r IP] [-V VENDOR] [-F NAME] [-x OPT:VAL]... [-O OPT]... -i IFACE Interface to use (default eth0) -P PORT Use PORT (default 68) -s PROG Run PROG at DHCP events (default /usr/share/udhcpc/default.script) -p FILE Create pidfile -B Request broadcast replies -t N Send up to N discover packets (default 3) -T SEC Pause between packets (default 3) -A SEC Wait if lease is not obtained (default 20) -b Background if lease is not obtained -n Exit if lease is not obtained -q Exit after obtaining lease -R Release IP on exit -f Run in foreground -S Log to syslog too -r IP Request this IP address -o Don't request any options (unless -O is given) -O OPT Request option OPT from server (cumulative) -x OPT:VAL Include option OPT in sent packets (cumulative) Examples of string, numeric, and hex byte opts: -x hostname:bbox - option 12 -x lease:3600 - option 51 (lease time) -x 0x3d:0100BEEFC0FFEE - option 61 (client id) -x 14:'"dumpfile"' - option 14 (shell-quoted) -F NAME Ask server to update DNS mapping for NAME -V VENDOR Vendor identifier (default 'udhcp VERSION') -C Don't send MAC as client identifier -v Verbose Signals: USR1 Renew lease USR2 Release lease udhcpc6 udhcpc6 [-fbnqvodR] [-i IFACE] [-r IPv6] [-s PROG] [-p PIDFILE] [-x OPT:VAL]... [-O OPT]... [-P N] -i IFACE Interface to use (default eth0) -p FILE Create pidfile -s PROG Run PROG at DHCP events (default /usr/share/udhcpc/default.script) -B Request broadcast replies -t N Send up to N discover packets -T N Pause between packets (default 3 seconds) -A N Wait N seconds (default 20) after failure -f Run in foreground -b Background if lease is not obtained -n Exit if lease is not obtained -q Exit after obtaining lease -R Release IP on exit -S Log to syslog too -P N Use port N (default 546) -O OPT Request option OPT from server (cumulative) -o Don't request any options (unless -O is given) -r IPv6 Request this address ('no' to not request any IP) -d Request prefix -l Send 'information request' instead of 'solicit' (used for servers which do not assign IPv6 addresses) -x OPT:VAL Include option OPT in sent packets (cumulative) Examples of string, numeric, and hex byte opts: -x hostname:bbox - option 12 -x lease:3600 - option 51 (lease time) -x 0x3d:0100BEEFC0FFEE - option 61 (client id) -x 14:'"dumpfile"' - option 14 (shell-quoted) -v Verbose Signals: USR1 Renew lease USR2 Release lease umount umount [OPTIONS] FILESYSTEM|DIRECTORY Unmount file systems -a Unmount all file systems -r Try to remount devices as read-only if mount is busy -l Lazy umount (detach filesystem) -f Force umount (i.e., unreachable NFS server) -d Free loop device if it has been used -t FSTYPE[,...] Unmount only these filesystem type(s) uname uname [-amnrspvio] Print system information -a Print all -m The machine (hardware) type -n Hostname -r Kernel release -s Kernel name (default) -p Processor type -v Kernel version -i The hardware platform -o OS name uniq uniq [-cdu][-f,s,w N] [INPUT [OUTPUT]] Discard duplicate lines -c Prefix lines by the number of occurrences -d Only print duplicate lines -u Only print unique lines -i Ignore case -f N Skip first N fields -s N Skip first N chars (after any skipped fields) -w N Compare N characters in line unlink unlink FILE Delete FILE by calling unlink() unshare unshare [OPTIONS] [PROG [ARGS]] -m,--mount[=FILE] Unshare mount namespace -u,--uts[=FILE] Unshare UTS namespace (hostname etc.) -i,--ipc[=FILE] Unshare System V IPC namespace -n,--net[=FILE] Unshare network namespace -p,--pid[=FILE] Unshare PID namespace -U,--user[=FILE] Unshare user namespace -f,--fork Fork before execing PROG -r,--map-root-user Map current user to root (implies -U) --mount-proc[=DIR] Mount /proc filesystem first (implies -m) --propagation slave|shared|private|unchanged Modify mount propagation in mount namespace --setgroups allow|deny Control the setgroups syscall in user namespaces unzip unzip [-lnojpq] FILE[.zip] [FILE]... [-x FILE...] [-d DIR] Extract FILEs from ZIP archive -l List contents (with -q for short form) -n Never overwrite files (default: ask) -o Overwrite -j Do not restore paths -p Print to stdout -q Quiet -x FILE Exclude FILEs -d DIR Extract into DIR uptime uptime Display the time since the last boot vi vi [OPTIONS] [FILE]... Edit FILE -c CMD Initial command to run ($EXINIT also available) -R Read-only -H List available features wc wc [-cmlwL] [FILE]... Count lines, words, and bytes for each FILE (or stdin) -c Count bytes -m Count characters -l Count newlines -w Count words -L Print longest line length wget wget [-c|--continue] [--spider] [-q|--quiet] [-O|--output-document FILE] [-o|--output-file FILE] [--header 'header: value'] [-Y|--proxy on/off] [-P DIR] [-S|--server-response] [-U|--user-agent AGENT] [-T SEC] URL... Retrieve files via HTTP or FTP --spider Only check URL existence: $? is 0 if exists -c Continue retrieval of aborted transfer -q Quiet -P DIR Save to DIR (default .) -S Show server response -T SEC Network read timeout is SEC seconds -O FILE Save to FILE ('-' for stdout) -o FILE Log messages to FILE -U STR Use STR for User-Agent header -Y on/off Use proxy which which [COMMAND]... Locate a COMMAND xxd xxd [OPTIONS] [FILE] Hex dump FILE (or stdin) -g N Bytes per group -c N Bytes per line -p Show only hex bytes, assumes -c30 -l LENGTH Show only first LENGTH bytes -s OFFSET Skip OFFSET bytes xz xz -d [-cfk] [FILE]... Decompress FILE (or stdin) -d Decompress -c Write to stdout -f Force -k Keep input files -t Test file integrity yes yes [STRING] Repeatedly output a line with STRING, or 'y' 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 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 run-parts Erik Andersen 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 rpm2cpio, unzip, get_header_cpio, read_gz interface, rpm Jeff Angielski ftpput, ftpget Edward Betts expr, hostid, logname, whoami John Beppu du, nslookup, sort Brian Candler tiny-ls(ls) Randolph Chung fbset, ping, hostname Dave Cinege more(v2), makedevs, dutmp, modularization, auto links file, various fixes, Linux Router Project maintenance Jordan Crouse ipcalc Magnus Damm tftp client insmod powerpc support Larry Doolittle pristine source directory compilation, lots of patches and fixes. Glenn Engel httpd Gennady Feldman Sysklogd (single threaded syslogd, IPC Circular buffer support, logread), various fixes. Karl M. Hegbloom cp_mv.c, the test suite, various fixes to utility.c, &c. Daniel Jacobowitz mktemp.c Matt Kraai documentation, bugfixes, test suite Stephan Linz ipcalc, Red Hat equivalence John Lombardo tr Glenn McGrath Common unarchiving code and unarchiving applets, ifupdown, ftpgetput, nameif, sed, patch, fold, install, uudecode. Various bugfixes, review and apply numerous patches. Manuel Novoa III 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 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 Original author of BusyBox in 1995, 1996. Some of his code can still be found hiding here and there... Tim Riker bug fixes, member of fan club Kent Robotti reset, tons and tons of bug reports and patches. Chip Rosenthal , wget - Contributed by permission of Covad Communications Pavel Roskin Lots of bugs fixes and patches. Gyepi Sam Remote logging feature for syslogd Linus Torvalds mkswap, fsck.minix, mkfs.minix Mark Whitley grep, sed, cut, xargs(previous), style-guide, new-applet-HOWTO, bug fixes, etc. Charles P. Wright gzip, mini-netcat(nc) Enrique Zanardi tarcat (since removed), loadkmap, various fixes, Debian maintenance Tito Ragusa devfsd and size optimizations in strings, openvt and deallocvt. Paul Fox vi editing mode for ash, various other patches/fixes Roberto A. Foglietta port: dnsd Bernhard Reutner-Fischer misc Mike Frysinger initial e2fsprogs, printenv, setarch, sum, misc Jie Zhang fixed two bugs in msh and hush (exitcode of killed processes)