1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [ ]>
2 <book id="BusyBoxDocumentation">
4 <title>BusyBox - The Swiss Army Knife of Embedded Linux</title>
8 This documentation is free software; you can redistribute
9 it and/or modify it under the terms of the GNU General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later
16 This program is distributed in the hope that it will be
17 useful, but WITHOUT ANY WARRANTY; without even the implied
18 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 See the GNU General Public License for more details.
23 You should have received a copy of the GNU General Public
24 License along with this program; if not, write to the Free
25 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 For more details see the file COPYING in the source
31 distribution of Linux.
37 <chapter id="Introduction">
38 <title>Introduction</title>
41 BusyBox combines tiny versions of many common UNIX utilities into a single
42 small executable. It provides minimalist replacements for most of the
43 utilities you usually find in fileutils, shellutils, findutils, textutils,
44 grep, gzip, tar, etc. BusyBox provides a fairly complete POSIX environment
45 for any small or embedded system. The utilities in BusyBox generally have
46 fewer options than their full-featured GNU cousins; however, the options
47 that are included provide the expected functionality and behave very much
48 like their GNU counterparts.
52 BusyBox has been written with size-optimization and limited resources in
53 mind. It is also extremely modular so you can easily include or exclude
54 commands (or features) at compile time. This makes it easy to customize
55 your embedded systems. To create a working system, just add a kernel, a
56 shell (such as ash), and an editor (such as elvis-tiny or ae).
61 <title>How to use BusyBox</title>
62 <sect1 id="How-to-use-BusyBox">
67 BusyBox <function> [arguments...] # or
73 <function> [arguments...] # if symlinked
78 <sect1 id="Invoking-BusyBox">
79 <title>Invoking BusyBox</title>
82 When you create a link to BusyBox for the function you wish to use, when
83 BusyBox is called using that link it will behave as if the command itself
99 will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiled
104 You can also invoke BusyBox by issuing the command as an argument on the
105 command line. For example, entering
115 will also cause BusyBox to behave as 'ls'.
120 <sect1 id="Common-options">
121 <title>Common options</title>
124 Most BusyBox commands support the <emphasis>--help</emphasis> option to provide
125 a terse runtime description of their behavior.
130 <chapter id="Commands">
131 <title>BusyBox Commands</title>
132 <sect1 id="Available-BusyBox-Commands">
133 <title>Available BusyBox Commands</title>
135 Currently defined functions include:
139 addgroup, adduser, adjtimex, ar, basename, busybox, cat,
140 chgrp, chmod, chown, chroot, chvt, clear, cmp, cp, cpio, cut,
141 date, dc, dd, deallocvt, deluser, df, dirname, dmesg,
142 dos2unix, dpkg, dpkg-deb, du, dumpkmap, dutmp, echo, expr,
143 false, fbset, fdflush, find, free, freeramdisk, fsck.minix,
144 getopt, getty, grep, gunzip, gzip, halt, head, hostid,
145 hostname, id, ifconfig, init, insmod, kill, killall, klogd,
146 length, ln, loadacm, loadfont, loadkmap, logger, logname, ls,
147 lsmod, makedevs, md5sum, mkdir, mkfifo, mkfs.minix, mknod,
148 mkswap, mktemp, more, mount, mt, mv, nc, nslookup, ping,
149 pivot_root, poweroff, printf, ps, pwd, rdate, readlink,
150 reboot, renice, reset, rm, rmdir, rmmod, route, rpm2cpio,
151 sed, setkeycodes, sh, sleep, sort, stty, swapoff, swapon,
152 sync, syslogd, tail, tar, tee, telnet, test, tftp, touch, tr,
153 true, tty, umount, uname, uniq, unix2dos, update, uptime,
154 usleep, uudecode, uuencode, watchdog, wc, wget, which,
155 whoami, xargs, yes, zcat, [
163 Usage: ar [OPTION] archive [FILENAME]...
167 Extract or list files from an ar archive.
176 o Preserve original dates
180 v Verbosely list files processed
185 <sect1 id="basename">
186 <title>basename</title>
188 Usage: basename FILE [SUFFIX]
192 Strip directory path and suffixes from FILE. If specified, also removes
202 $ basename /usr/local/bin/foo
204 $ basename /usr/local/bin/
206 $ basename /foo/bar.txt .txt
220 Concatenate <literal>FILE(s)</literal> and prints them to the standard
240 Usage: chgrp [OPTION]... GROUP FILE...
244 Change the group membership of each FILE to GROUP.
253 -R Change files and directories recursively
264 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
265 $ chgrp root /tmp/foo
267 -r--r--r-- 1 andersen root 0 Apr 12 18:25 /tmp/foo
276 Usage: chmod [<emphasis>-R</emphasis>] MODE[,MODE]... FILE...
280 Change file access permissions for the specified
281 <literal>FILE(s)</literal> (or directories). Each MODE is defined by
282 combining the letters for WHO has access to the file, an OPERATOR for
283 selecting how the permissions should be changed, and a PERMISSION for
284 <literal>FILE(s)</literal> (or directories).
288 WHO may be chosen from
293 u User who owns the file
294 g Users in the file's Group
295 o Other users not in the file's group
301 OPERATOR may be chosen from
307 - Remove a permission
308 = Assign a permission
313 PERMISSION may be chosen from
320 x Execute (or access for directories)
321 s Set user (or group) ID bit
322 t Sticky bit (for directories prevents removing files by non-owners)
327 Alternately, permissions can be set numerically where the first three
328 numbers are calculated by adding the octal values, such as
340 An optional fourth digit can also be used to specify
357 -R Change files and directories recursively.
368 -rw-rw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo
371 -rwxrw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo*
374 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
382 Usage: chown [OPTION]... OWNER[<.|:>[GROUP] FILE...
386 Change the owner and/or group of each FILE to OWNER and/or GROUP.
395 -R Change files and directories recursively
406 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
407 $ chown root /tmp/foo
409 -r--r--r-- 1 root andersen 0 Apr 12 18:25 /tmp/foo
410 $ chown root.root /tmp/foo
412 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
418 <title>chroot</title>
420 Usage: chroot NEWROOT [COMMAND...]
424 Run COMMAND with root directory set to NEWROOT.
434 lrwxrwxrwx 1 root root 12 Apr 13 00:46 /bin/ls -> /BusyBox
435 $ mount /dev/hdc1 /mnt -t minix
438 -rwxr-xr-x 1 root root 40816 Feb 5 07:45 /bin/ls*
450 Change the foreground virtual terminal to /dev/ttyN
470 Usage: cp [OPTION]... SOURCE DEST
475 or: cp [OPTION]... SOURCE... DIRECTORY
480 Copy SOURCE to DEST, or multiple <literal>SOURCE(s)</literal> to
492 -p Preserve file attributes if possible
493 -R Copy directories recursively
502 Usage: cut [OPTION]... [FILE]...
506 Print selected fields from each input FILE to standard output.
515 -b LIST Output only bytes from LIST
516 -c LIST Output only characters from LIST
517 -d CHAR Use CHAR instead of tab as the field delimiter
518 -s Output only the lines containing delimiter
519 -f N Print only these fields
530 $ echo "Hello world" | cut -f 1 -d ' '
532 $ echo "Hello world" | cut -f 2 -d ' '
542 Usage: date [OPTION]... [+FORMAT]
547 or: date [OPTION] [MMDDhhmm[[CC]YY][.ss]]
552 Display the current time in the given FORMAT, or set the system date.
561 -R Output RFC-822 compliant date string
562 -s Set time described by STRING
563 -u Print or set Coordinated Universal Time
574 Wed Apr 12 18:52:41 MDT 2000
583 Usage: dc [EXPRESSION]
587 This is a Tiny RPN calculator that understands the
588 following operations: +, -, /, *, and, or, not, eor. If
589 no arguments are given, dc will process input from
594 The behaviour of BusyBox/dc deviates (just a little ;-)
595 from GNU/dc, but this will be remedied in the future.
612 $ echo 72 9 div 8 mul | dc
622 Usage: dd [OPTION]...
626 Copy a file, converting and formatting according to
636 if=FILE Read from FILE instead of stdin
637 of=FILE Write to FILE instead of stdout
638 bs=N Read and write N bytes at a time
639 count=N Copy only N input blocks
640 skip=N Skip N input blocks
641 seek=N Skip N output blocks
646 Numbers may be suffixed by w (x2), k (x1024), b (x512),
656 $ dd if=/dev/zero of=/dev/ram1 bs=1M count=4
663 <sect1 id="deallocvt">
664 <title>deallocvt</title>
671 Deallocate unused virtual terminal /dev/ttyN.
683 Print the filesystem space used and space available.
693 Filesystem 1k-blocks Used Available Use% Mounted on
694 /dev/sda3 8690864 8553540 137324 98% /
695 /dev/sda1 64216 36364 27852 57% /boot
697 Filesystem 1k-blocks Used Available Use% Mounted on
698 /dev/sda3 8690864 8553540 137324 98% /
704 <title>dirname</title>
711 Strip non-directory suffix from NAME.
732 Usage: dmesg [OPTION]...
736 Print or control the kernel ring buffer.
745 -c Clear the ring buffer after printing
746 -n LEVEL Set the console logging level to LEVEL
747 -s BUFSIZE Query ring buffer using a buffer of BUFSIZE
752 <sect1 id="dos2unix">
753 <title>dos2unix</title>
756 Usage: dos2unix < dosfile > unixfile
760 Converts a text file from dos format to unix format.
765 <sect1 id="dpkg-deb">
766 <title>dpkg-deb</title>
769 Usage: dpkg-deb [OPTION] archive [directory]
773 Debian package archive (.deb) manipulation tool
782 -c List the contents of the filesystem tree archive portion of the package
783 -e Extracts the control information files from a package archive into the specified directory.
784 If no directory is specified then a subdirectory DEBIAN in the current directory is used.
785 -x Silently extracts the filesystem tree from a package archive into the specified directory.
786 -X Extracts the filesystem tree from a package archive into the specified directory, listing the files as it goes.
787 If required the specified directory (but not its parents) will be created.
797 dpkg-deb -e ./busybox_0.48-1_i386.deb
798 dpkg-deb -x ./busybox_0.48-1_i386.deb ./unpack_dir
807 Usage: du [OPTION]... [FILE]...
811 Summarize the disk space used for each FILE or current
812 directory. Disk space printed in units of 1k (i.e.,
822 -l Count sizes many times if hard linked
823 -s Display only a total for each argument
835 12 ./kernel-patches/CVS
848 <sect1 id="dumpkmap">
849 <title>dumpkmap</title>
856 Prints out a binary keyboard translation table to standard output.
865 $ dumpkmap < keymap
878 Dump utmp file format (pipe delimited) from FILE or
888 $ dutmp /var/run/utmp
889 8|7||si|||0|0|0|955637625|760097|0
890 2|0|~|~~|reboot||0|0|0|955637625|782235|0
891 1|20020|~|~~|runlevel||0|0|0|955637625|800089|0
892 8|125||l4|||0|0|0|955637629|998367|0
893 6|245|tty1|1|LOGIN||0|0|0|955637630|998974|0
894 6|246|tty2|2|LOGIN||0|0|0|955637630|999498|0
895 7|336|pts/0|vt00andersen|andersen|:0.0|0|0|0|955637763|0|0
904 Usage: echo [OPTION]... [ARG]...
908 Print ARGs to stdout.
917 -n Suppress trailing newline
918 -e Enable interpretation of escaped characters
919 -E Disable interpretation of escaped characters
929 $ echo "Erik is cool"
931 $ echo -e "Erik\nis\ncool"
935 $ echo "Erik\nis\ncool"
945 Usage: expr EXPRESSION
949 Prints the value of EXPRESSION to standard output.
958 ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2
959 ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0
960 ARG1 < ARG2 ARG1 is less than ARG2
961 ARG1 <= ARG2 ARG1 is less than or equal to ARG2
962 ARG1 = ARG2 ARG1 is equal to ARG2
963 ARG1 != ARG2 ARG1 is unequal to ARG2
964 ARG1 >= ARG2 ARG1 is greater than or equal to ARG2
965 ARG1 > ARG2 ARG1 is greater than ARG2
966 ARG1 + ARG2 arithmetic sum of ARG1 and ARG2
967 ARG1 - ARG2 arithmetic difference of ARG1 and ARG2
968 ARG1 * ARG2 arithmetic product of ARG1 and ARG2
969 ARG1 / ARG2 arithmetic quotient of ARG1 divided by ARG2
970 ARG1 % ARG2 arithmetic remainder of ARG1 divided by ARG2
971 STRING : REGEXP anchored pattern match of REGEXP in STRING
972 match STRING REGEXP same as STRING : REGEXP
973 substr STRING POS LENGTH substring of STRING, POS counted from 1
974 index STRING CHARS index in STRING where any CHARS is found, or 0
975 length STRING length of STRING
976 quote TOKEN interpret TOKEN as a string, even if it is a
977 keyword like `match' or an operator like `/'
978 ( EXPRESSION ) value of EXPRESSION
983 Beware that many operators need to be escaped or quoted for shells.
984 Comparisons are arithmetic if both ARGs are numbers, else
985 lexicographical. Pattern matches return the string matched between
986 \( and \) or null; if \( and \) are not used, they return the number
987 of characters matched or 0.
1001 Return an exit code of FALSE (1).
1018 <title>fbset</title>
1021 Usage: fbset [OPTION]... [MODE]
1025 Show and modify frame buffer device settings.
1034 -h Display option summary
1035 -fb DEVICE Operate on DEVICE
1036 -db FILE Use FILE for mode database
1037 -g XRES YRES VXRES VYRES DEPTH Set all geometry parameters
1038 -t PIXCLOCK LEFT RIGHT UPPER LOWER HSLEN VSLEN Set all timing parameters
1039 -xres RES Set visible horizontal resolution
1040 -yres RES Set visible vertical resolution
1052 # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz
1053 geometry 1024 768 1024 768 16
1054 timings 12714 128 32 16 4 128 4
1056 rgba 5/11,6/5,5/0,0/0
1062 <sect1 id="fdflush">
1063 <title>fdflush</title>
1066 Usage: fdflush DEVICE
1070 Force floppy disk drive to detect disk change on DEVICE.
1078 Usage: find [PATH]... [EXPRESSION]
1082 Search for files in a directory hierarchy. The default
1083 PATH is the current directory; default EXPRESSION is
1088 EXPRESSION may consist of:
1093 -follow Dereference symbolic links
1094 -name PATTERN File name (leading directories removed) matches PATTERN
1095 -type X Filetype matches X (where X is one of: f,d,l,b,c,...)
1096 -perm PERMS Permissions match any of (+NNN); all of (-NNN); or exactly (NNN)
1097 -mtime TIME Modified time is greater than (+N); less than (-N); or exactly (N) days
1107 $ find / -name /etc/passwd
1121 Displays the amount of free and used system memory.
1131 total used free shared buffers
1132 Mem: 257628 248724 8904 59644 93124
1133 Swap: 128516 8404 120112
1134 Total: 386144 257128 129016
1139 <sect1 id="freeramdisk">
1140 <title>freeramdisk</title>
1143 Usage: freeramdisk DEVICE
1147 Free all memory used by the ramdisk DEVICE.
1156 $ freeramdisk /dev/ram2
1161 <sect1 id="fsck.minix">
1162 <title>fsck.minix</title>
1165 Usage: fsck.minix [OPTION]... DEVICE
1169 Perform a consistency check on the MINIX filesystem on
1179 -l List all filenames
1180 -r Perform interactive repairs
1181 -a Perform automatic repairs
1183 -s Output super-block information
1184 -m Activate MINIX-like "mode not cleared" warnings
1185 -f Force file system check.
1191 <title>getopt</title>
1194 Usage: getopt [OPTIONS]...
1198 Parse command options
1203 -a, --alternative Allow long options starting with single -\n"
1204 -l, --longoptions=longopts Long options to be recognized\n"
1205 -n, --name=progname The name under which errors are reported\n"
1206 -o, --options=optstring Short options to be recognized\n"
1207 -q, --quiet Disable error reporting by getopt(3)\n"
1208 -Q, --quiet-output No normal output\n"
1209 -s, --shell=shell Set shell quoting conventions\n"
1210 -T, --test Test for getopt(1) version\n"
1211 -u, --unqote Do not quote the output\n"
1224 GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \
1225 -n 'example.busybox' -- "$@"`
1226 if [ $? != 0 ] ; then exit 1 ; fi
1227 eval set -- "$GETOPT"
1230 -a|--a-long) echo "Option a" ; shift ;;
1231 -b|--b-long) echo "Option b, argument \`$2'" ; shift 2 ;;
1234 "") echo "Option c, no argument"; shift 2 ;;
1235 *) echo "Option c, argument \`$2'" ; shift 2 ;;
1237 --) shift ; break ;;
1238 *) echo "Internal error!" ; exit 1 ;;
1249 Usage: grep [OPTIONS]... PATTERN [FILE]...
1253 Search for PATTERN in each FILE or stdin.
1262 -h Suppress the prefixing filename on output
1263 -i Ignore case distinctions
1264 -n Print line number with output lines
1265 -q Be quiet. Returns 0 if result was found, 1 otherwise
1266 -v Select non-matching lines
1271 This version of grep matches full regular expressions.
1280 $ grep root /etc/passwd
1281 root:x:0:0:root:/root:/bin/bash
1282 $ grep ^[rR]oo. /etc/passwd
1283 root:x:0:0:root:/root:/bin/bash
1289 <title>gunzip</title>
1292 Usage: gunzip [OPTION]... FILE
1296 Uncompress FILE (or stdin if FILE is '-').
1305 -c Write output to standard output
1306 -t Test compressed file integrity
1316 $ ls -la /tmp/BusyBox*
1317 -rw-rw-r-- 1 andersen andersen 557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz
1318 $ gunzip /tmp/BusyBox-0.43.tar.gz
1319 $ ls -la /tmp/BusyBox*
1320 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1329 Usage: gzip [OPTION]... FILE
1333 Compress FILE (or stdin if FILE is '-') with maximum
1334 compression to FILE.gz (or stdout if FILE is '-').
1343 -c Write output to standard output
1354 $ ls -la /tmp/BusyBox*
1355 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1356 $ gzip /tmp/BusyBox-0.43.tar
1357 $ ls -la /tmp/BusyBox*
1358 -rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/BusyBox-0.43.tar.gz
1379 Usage: head [OPTION] FILE...
1383 Print first 10 lines of each FILE to standard output.
1384 With more than one FILE, precede each with a header
1385 giving the file name. With no FILE, or when FILE is -,
1386 read standard input.
1395 -n NUM Print first NUM lines instead of first 10
1405 $ head -n 2 /etc/passwd
1406 root:x:0:0:root:/root:/bin/bash
1407 daemon:x:1:1:daemon:/usr/sbin:/bin/sh
1413 <title>hostid</title>
1420 Prints out a unique 32-bit identifier for the current
1421 machine. The 32-bit identifier is intended to be unique
1422 among all UNIX systems in existence.
1426 <sect1 id="hostname">
1427 <title>hostname</title>
1430 Usage: hostname [OPTION]... [HOSTNAME|-F FILE]
1434 Get or set the hostname or DNS domain name. If a
1435 hostname is given (or a file with the -F parameter), the
1436 host name will be set.
1446 -i Addresses for the hostname
1448 -F, --file FILE Use the contents of FILE to specify the hostname
1468 Usage: id [OPTION]... [USERNAME]
1472 Print information for USERNAME or the current user.
1481 -g Print only the group ID
1482 -u Print only the user ID
1483 -n print a name instead of a number (with for -ug)
1484 -r Print the real user ID instead of the effective ID (with -ug)
1495 uid=1000(andersen) gid=1000(andersen)
1508 Init is the parent of all processes.
1512 This version of init is designed to be run only by the
1517 BusyBox init doesn't support multiple runlevels. The
1518 runlevels field of the /etc/inittab file is completely
1519 ignored by BusyBox init. If you want runlevels, use
1524 BusyBox init works just fine without an inittab. If no
1525 inittab is found, it has the following default behavior:
1530 ::sysinit:/etc/init.d/rcS
1536 If it detects that /dev/console is _not_ a serial
1537 console, it will also run:
1542 tty2::askfirst:/bin/sh
1547 If you choose to use an /etc/inittab file, the inittab
1548 entry format is as follows:
1553 <id>:<runlevels>:<action>:<process>
1561 WARNING: This field has a non-traditional meaning for BusyBox init!
1562 The id field is used by BusyBox init to specify the controlling tty
1563 for the specified process to run on. The contents of this field
1564 are appended to "/dev/" and used as-is. There is no need for this
1565 field to be unique, although if it isn't you may have strange
1566 results. If this field is left blank, the controlling tty is set
1567 to the console. Also note that if BusyBox detects that a serial
1568 console is in use, then only entries whose controlling tty is
1569 either the serial console or /dev/null will be run. BusyBox init
1570 does nothing with utmp. We don't need no stinkin' utmp.
1576 <title>runlevels</title>
1579 The runlevels field is completely ignored.
1584 <title>action</title>
1588 Valid actions include: sysinit, respawn, askfirst, wait,
1589 once, and ctrlaltdel.
1594 The available actions can be classified into two groups: actions
1595 that are run only once, and actions that are re-run when the specified
1600 Run only-once actions:
1604 'sysinit' is the first item run on boot. init waits until all
1605 sysinit actions are completed before continuing. Following the
1606 completion of all sysinit actions, all 'wait' actions are run.
1607 'wait' actions, like 'sysinit' actions, cause init to wait until
1608 the specified task completes. 'once' actions are asyncronous,
1609 therefore, init does not wait for them to complete. 'ctrlaltdel'
1610 actions are run immediately before init causes the system to reboot
1611 (unmounting filesystems with a 'ctrlaltdel' action is a very good
1616 Run repeatedly actions:
1620 'respawn' actions are run after the 'once' actions. When a process
1621 started with a 'respawn' action exits, init automatically restarts
1622 it. Unlike sysvinit, BusyBox init does not stop processes from
1623 respawning out of control. The 'askfirst' actions acts just like
1624 respawn, except that before running the specified process it
1625 displays the line "Please press Enter to activate this console."
1626 and then waits for the user to press enter before starting the
1631 Unrecognized actions (like initdefault) will cause init to emit an
1632 error message, and then go along with its business. All actions are
1633 run in the reverse order from how they appear in /etc/inittab.
1639 <title>process</title>
1642 Specifies the process to be executed and its
1648 <title>Example /etc/inittab file</title>
1652 # This is run first except when booting in single-user mode.
1654 ::sysinit:/etc/init.d/rcS
1656 # /bin/sh invocations on selected ttys
1658 # Start an "askfirst" shell on the console (whatever that may be)
1660 # Start an "askfirst" shell on /dev/tty2-4
1661 tty2::askfirst:-/bin/sh
1662 tty2::askfirst:-/bin/sh
1663 tty2::askfirst:-/bin/sh
1665 # /sbin/getty invocations for selected ttys
1667 tty4::respawn:/sbin/getty 38400 tty5
1668 tty5::respawn:/sbin/getty 38400 tty6
1670 # Example of how to put a getty on a serial line (for a terminal)
1672 #::respawn:/sbin/getty -L ttyS0 9600 vt100
1673 #::respawn:/sbin/getty -L ttyS1 9600 vt100
1675 # Example how to put a getty on a modem line.
1676 #::respawn:/sbin/getty 57600 ttyS2
1678 # Stuff to do before rebooting
1679 ::ctrlaltdel:/bin/umount -a -r
1680 ::ctrlaltdel:/sbin/swapoff
1687 <title>insmod</title>
1690 Usage: insmod [OPTION]... MODULE [symbol=value]...
1694 Load MODULE into the kernel.
1703 -f Force module to load into the wrong kernel version.
1704 -k Make module autoclean-able.
1706 -x Do not export externs
1707 -L Prevent simultaneous loads of the same module
1716 Usage: kill [OPTION] PID...
1720 Send a signal (default is SIGTERM) to the specified
1730 -l List all signal names and numbers
1731 -SIG Send signal SIG
1742 252 root root S [apache]
1743 263 www-data www-data S [apache]
1744 264 www-data www-data S [apache]
1745 265 www-data www-data S [apache]
1746 266 www-data www-data S [apache]
1747 267 www-data www-data S [apache]
1753 <sect1 id="killall">
1754 <title>killall</title>
1757 Usage: killall [OPTION] NAME...
1761 Send a signal (default is SIGTERM) to the specified
1771 -l List all signal names and numbers
1772 -SIG Send signal SIG
1788 <title>length</title>
1791 Usage: length STRING
1795 Print the length of STRING.
1814 Usage: ln [OPTION]... TARGET FILE|DIRECTORY
1818 Create a link named FILE or DIRECTORY to the specified
1819 TARGET. You may use '--' to indicate that all following
1820 arguments are non-options.
1829 -s Make symbolic link instead of hard link
1830 -f Remove existing destination file
1840 $ ln -s BusyBox /tmp/ls
1842 lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -> BusyBox*
1847 <sect1 id="loadacm">
1848 <title>loadacm</title>
1855 Load an acm from stdin.
1864 $ loadacm < /etc/i18n/acmname
1869 <sect1 id="loadfont">
1870 <title>loadfont</title>
1877 Load a console font from stdin.
1886 $ loadfont < /etc/i18n/fontname
1891 <sect1 id="loadkmap">
1892 <title>loadkmap</title>
1899 Load a binary keyboard translation table from stdin.
1908 $ loadkmap < /etc/i18n/lang-keymap
1914 <title>logger</title>
1917 Usage: logger [OPTION]... [MESSAGE]
1921 Write MESSAGE to the system log. If MESSAGE is omitted, log
1931 -s Log to stderr as well as the system log
1932 -t Log using the specified tag (defaults to user name)
1933 -p Enter the message with the specified priority
1934 This may be numerical or a ``facility.level'' pair
1949 <sect1 id="logname">
1950 <title>logname</title>
1957 Print the name of the current user.
1976 Usage: ls [OPTION]... [FILE]...
1989 -a Do not hide entries starting with .
1990 -c With -l: show ctime (the time of last
1991 modification of file status information)
1992 -d List directory entries instead of contents
1993 -e List both full date and full time
1994 -l Use a long listing format
1995 -n List numeric UIDs and GIDs instead of names
1996 -p Append indicator (one of /=@|) to entries
1997 -u With -l: show access time (the time of last
1999 -x List entries by lines instead of by columns
2000 -A Do not list implied . and ..
2001 -C List entries by columns
2002 -F Append indicator (one of */=@|) to entries
2003 -L list entries pointed to by symbolic links
2004 -R List subdirectories recursively
2019 <title>lsmod</title>
2026 List currently loaded kernel modules.
2030 <sect1 id="makedevs">
2031 <title>makedevs</title>
2034 Usage: makedevsf NAME TYPE MAJOR MINOR FIRST LAST [s]
2038 Create a range of block or character special files.
2047 b Make a block (buffered) device
2048 c or u Make a character (un-buffered) device
2049 p Make a named pipe. MAJOR and MINOR are ignored for named pipes
2054 FIRST specifies the number appended to NAME to create
2055 the first device. LAST specifies the number of the last
2056 item that should be created. If 's' is the last
2057 argument, the base device is created as well.
2066 $ makedevs /dev/ttyS c 4 66 2 63
2067 [creates ttyS2-ttyS63]
2068 $ makedevs /dev/hda b 3 0 0 8 s
2069 [creates hda,hda1-hda8]
2075 <title>md5sum</title>
2078 Usage: md5sum [OPTION]... FILE...
2082 Print or check MD5 checksums.
2091 -b Read files in binary mode
2092 -c Check MD5 sums against given list
2093 -t Read files in text mode (default)
2099 The following two options are useful only when verifying
2105 -s Don't output anything, status code shows success
2106 -w Warn about improperly formated MD5 checksum lines
2117 6fd11e98b98a58f64ff3398d7b324003 busybox
2119 6fd11e98b98a58f64ff3398d7b324003 busybox
2120 6fd11e98b98a58f64ff3398d7b324002 busybox
2121 md5sum: MD5 check failed for 'busybox'
2128 <title>mkdir</title>
2131 Usage: mkdir [OPTION]... DIRECTORY...
2135 Create the DIRECTORY(s), if they do not already exist.
2144 -m Set permission mode (as in chmod), not rwxrwxrwx - umask
2145 -p No error if directory exists, make parent directories as needed
2157 /tmp/foo: File exists
2158 $ mkdir /tmp/foo/bar/baz
2159 /tmp/foo/bar/baz: No such file or directory
2160 $ mkdir -p /tmp/foo/bar/baz
2166 <title>mkfifo</title>
2169 Usage: mkfifo [OPTION] NAME
2173 Create a named pipe (identical to 'mknod NAME p').
2182 -m MODE Create the pipe using the specified mode (default a=rw)
2187 <sect1 id="mkfs.minix">
2188 <title>mkfs.minix</title>
2191 Usage: mkfs.minix [OPTION]... NAME [BLOCKS]
2195 Make a MINIX filesystem.
2204 -c Check the device for bad blocks
2205 -n [14|30] Specify the maximum length of filenames
2206 -i Specify the number of inodes for the filesystem
2207 -l FILENAME Read the bad blocks list from FILENAME
2208 -v Make a Minix version 2 filesystem
2214 <title>mknod</title>
2217 Usage: mknod [OPTION]... NAME TYPE MAJOR MINOR
2221 Create a special file (block, character, or pipe).
2230 -m Create the special file using the specified mode (default a=rw)
2240 b Make a block (buffered) device
2241 c or u Make a character (un-buffered) device
2242 p Make a named pipe. MAJOR and MINOR are ignored for named pipes
2252 $ mknod /dev/fd0 b 2 0
2253 $ mknod -m 644 /tmp/pipe p
2259 <title>mkswap</title>
2262 Usage: mkswap [OPTION]... DEVICE [BLOCKS]
2266 Prepare a disk partition to be used as a swap partition.
2275 -c Check for read-ability.
2276 -v0 Make version 0 swap [max 128 Megs].
2277 -v1 Make version 1 swap [big!] (default for kernels > 2.1.117).
2278 BLOCKS Number of block to use (default is entire partition).
2284 <title>mktemp</title>
2287 Usage: mktemp TEMPLATE
2291 Creates a temporary file with its name based on
2292 TEMPLATE. TEMPLATE is any name with six `Xs' (i.e.,
2302 $ mktemp /tmp/temp.XXXXXX
2304 $ ls -la /tmp/temp.mWiLjM
2305 -rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM
2314 Usage: more [FILE]...
2318 Page through text one screenful at a time.
2333 <title>mount</title>
2336 Usage: mount [OPTION]...
2341 or: mount [OPTION]... DEVICE DIRECTORY
2355 -a Mount all filesystems in /etc/fstab
2356 -o One of the many filesystem options listed below
2357 -r Mount the filesystem read-only
2358 -t TYPE Specify the filesystem type
2359 -w Mount the filesystem read-write
2364 Options for use with the -o flag:
2369 async/sync Writes are asynchronous / synchronous
2370 atime/noatime Enable / disable updates to inode access times
2371 dev/nodev Allow / disallow use of special device files
2372 exec/noexec Allow / disallow use of executable files
2373 loop Mount a file via loop device
2374 suid/nosuid Allow / disallow set-user-id-root programs
2375 remount Remount a currently mounted filesystem
2376 ro/rw Mount filesystem read-only / read-write
2381 There are even more flags that are filesystem specific.
2382 You'll have to see the written documentation for those.
2392 /dev/hda3 on / type minix (rw)
2393 proc on /proc type proc (rw)
2394 devpts on /dev/pts type devpts (rw)
2395 $ mount /dev/fd0 /mnt -t msdos -o ro
2396 $ mount /tmp/diskimage /opt -t ext2 -o loop
2405 Usage: mt [OPTION] OPCODE VALUE
2409 Control magnetic tape drive operation.
2418 -f DEVICE Control DEVICE
2427 Usage: mv SOURCE DEST
2432 or: mv SOURCE... DIRECTORY
2437 Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
2446 $ mv /tmp/foo /bin/bar
2464 Open a pipe to HOST:PORT or listen for a connection on PORT.
2473 $ nc foobar.somedomain.com 25
2474 220 foobar ESMTP Exim 3.12 #1 Sat, 15 Apr 2000 00:03:02 -0600
2476 214-Commands supported:
2477 214- HELO EHLO MAIL RCPT DATA AUTH
2478 214 NOOP QUIT RSET HELP
2480 221 foobar closing connection
2485 <sect1 id="nslookup">
2486 <title>nslookup</title>
2489 Usage: nslookup [HOST]
2493 Query the nameserver for the IP address of the given
2503 $ nslookup localhost
2517 Usage: ping [OPTION]... HOST
2521 Send ICMP ECHO_REQUEST packets to HOST.
2530 -c COUNT Send only COUNT pings
2531 -s SIZE Send SIZE data bytes in packets (default=56)
2532 -q Quiet mode, only displays output at start and when finished
2543 PING slag (127.0.0.1): 56 data bytes
2544 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=20.1 ms
2546 --- debian ping statistics ---
2547 1 packets transmitted, 1 packets received, 0% packet loss
2548 round-trip min/avg/max = 20.1/20.1/20.1 ms
2553 <sect1 id="poweroff">
2554 <title>poweroff</title>
2561 Shut down the system, and request that the kernel turn
2562 off power upon halting.
2567 <title>printf</title>
2570 Usage: printf FORMAT [ARGUMENT]...
2574 Format and print the given data in a manner similar to
2575 the C printf command.
2584 $ printf "Val=%d\n" 5
2598 Report process status. This version of ps accepts no
2618 PID Uid Gid State Command
2620 2 root root S [kflushd]
2621 3 root root S [kupdate]
2622 4 root root S [kpiod]
2623 5 root root S [kswapd]
2624 742 andersen andersen S [bash]
2625 743 andersen andersen S -bash
2626 745 root root S [getty]
2627 2990 andersen andersen R ps
2640 Print the full filename of the current working
2657 <title>rdate</title>
2660 Usage: rdate [OPTION] HOST
2664 Get and possibly set the system date and time from a remote HOST.
2673 -s Set the system date and time (default).
2674 -p Print the date and time.
2680 <title>reboot</title>
2692 <title>renice</title>
2695 Usage: renice priority pid [pid ...]
2699 Changes priority of running processes. Allowed priorities range
2700 from 20 (the process runs only when nothing else is running) to 0
2701 (default priority) to -20 (almost nothing else ever gets to run).
2706 <title>reset</title>
2721 Usage: rm [OPTION]... FILE...
2725 Remove (unlink) the FILE(s). You may use '--' to
2726 indicate that all following arguments are non-options.
2735 -i Always prompt before removing each destinations
2736 -f Remove existing destinations, never prompt
2737 -r or -R Remove the contents of directories recursively
2753 <title>rmdir</title>
2756 Usage: rmdir DIRECTORY...
2760 Remove DIRECTORY(s) if they are empty.
2775 <title>rmmod</title>
2778 Usage: rmmod [OPTION]... [MODULE]...
2782 Unload MODULE(s) from the kernel.
2791 -a Remove all unused modules (recursively)
2806 <sect1 id="run-parts">
2807 <title>run-parts</title>
2810 Usage: run-parts [-t] [-a ARG] [-u MASK] DIRECTORY
2814 Run a bunch of scripts in a directory.
2823 -t Test only. It only print the file to be executed,
2824 without execute them.
2825 -a ARG Pass ARG as an a argument to the programs executed.
2826 -u MASK Set the umask to MASK before executing the programs.
2837 Usage: sed [OPTION]... SCRIPT [FILE]...
2841 Allowed sed scripts come in the following form:
2856 NUMBER Match specified line number
2858 /REGEXP/ Match specified regexp
2863 ! inverts the meaning of the match
2872 s/regexp/replacement/[igp]
2873 which attempt to match regexp against the pattern space
2874 and if successful replaces the matched portion with replacement.
2876 which appends TEXT after the pattern space
2881 This version of sed matches full regular expressions.
2890 -e Add the script to the commands to be executed
2891 -n Suppress automatic printing of pattern space
2901 $ echo "foo" | sed -e 's/f[a-zA-Z]o/bar/g'
2907 <sect1 id="setkeycodes">
2908 <title>setkeycodes</title>
2911 Usage: setkeycodes SCANCODE KEYCODE ...
2915 Set entries into the kernel's scancode-to-keycode map,
2916 allowing unusual keyboards to generate usable keycodes.
2920 SCANCODE may be either xx or e0xx (hexadecimal), and
2921 KEYCODE is given in decimal.
2930 $ setkeycodes e030 127
2944 lash -- the BusyBox LAme SHell (command interpreter)
2948 This command does not yet have proper documentation.
2952 Use lash just as you would use any other shell. It
2953 properly handles pipes, redirects, job control, can be
2954 used as the shell for scripts (#!/bin/sh), and has a
2955 sufficient set of builtins to do what is needed. It does
2956 not (yet) support Bourne Shell syntax. If you need
2957 things like ``if-then-else'', ``while'', and such, use
2958 ash or bash. If you just need a very simple and
2959 extremely small shell, this will do the job.
2964 <title>sleep</title>
2971 Pause for N seconds.
2981 [2 second delay results]
2990 Usage: sort [OPTION]... [FILE]...
2994 Sort lines of text in FILE(s).
3003 -n Compare numerically
3004 -r Reverse after sorting
3014 $ echo -e "e\nf\nb\nd\nc\na" | sort
3025 <sect1 id="swapoff">
3026 <title>swapoff</title>
3029 Usage: swapoff [OPTION] [DEVICE]
3033 Stop swapping virtual memory pages on DEVICE.
3042 -a Stop swapping on all swap devices
3048 <title>swapon</title>
3051 Usage: swapon [OPTION] [DEVICE]
3055 Start swapping virtual memory pages on the given device.
3064 -a Start swapping on all swap devices
3077 Write all buffered filesystem blocks to disk.
3081 <sect1 id="syslogd">
3082 <title>syslogd</title>
3085 Usage: syslogd [OPTION]...
3089 Linux system and kernel (provides klogd) logging
3090 utility. Note that this version of syslogd/klogd ignores
3100 -m NUM Interval between MARK lines (default=20min, 0=off)
3101 -n Run as a foreground process
3102 -K Do not start up the klogd process
3103 -O FILE Use an alternate log file (default=/var/log/messages)
3104 -R HOST[:PORT] Log remotely to IP or hostname on PORT (default PORT=514/UDP)
3105 -L Log locally as well as network logging (default is network only)
3106 -C Log to a circular buffer. Read this buffer using 'logread'
3116 $ syslogd -R masterlog:514
3117 $ syslogd -R 192.168.1.1:601
3126 Usage: tail [OPTION] [FILE]...
3130 Print last 10 lines of each FILE to standard output.
3131 With more than one FILE, precede each with a header
3132 giving the file name. With no FILE, or when FILE is -,
3142 -n NUM Print last NUM lines instead of last 10
3143 -f Output data as the file grows. This version
3144 of 'tail -f' supports only one file at a time.
3154 $ tail -n 1 /etc/resolv.conf
3164 Usage: tar [MODE] [OPTION] [FILE]...
3172 MODE may be chosen from
3189 f FILE Use FILE for tarfile (or stdin if '-')
3191 exclude FILE File to exclude
3192 v List files processed
3202 $ zcat /tmp/tarball.tar.gz | tar -xf -
3203 $ tar -cf /tmp/tarball.tar /usr/local
3212 Usage: tee [OPTION]... [FILE]...
3216 Copy stdin to FILE(s), and also to stdout.
3225 -a Append to the given FILEs, do not overwrite
3235 $ echo "Hello" | tee /tmp/foo
3244 <title>telnet</title>
3247 Usage: telnet HOST [PORT]
3251 Establish interactive communication with another
3252 computer over a network using the TELNET protocol.
3257 <title>test, [</title>
3260 Usage: test EXPRESSION
3268 Check file types and compare values returning an exit
3269 code determined by the value of EXPRESSION.
3295 <title>touch</title>
3298 Usage: touch [OPTION]... FILE...
3302 Update the last-modified date on (or create) FILE(s).
3311 -c Do not create files
3322 /bin/ls: /tmp/foo: No such file or directory
3325 -rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo
3334 Usage: tr [OPTION]... STRING1 [STRING2]
3338 Translate, squeeze, and/or delete characters from stdin,
3348 -c Take complement of STRING1
3349 -d Delete input characters coded STRING1
3350 -s Squeeze multiple output characters of STRING2 into one character
3360 $ echo "gdkkn vnqkc" | tr [a-y] [b-z]
3374 Return an exit code of TRUE (1).
3398 Print the file name of the terminal connected to stdin.
3407 -s Print nothing, only return an exit status
3424 <title>umount</title>
3427 Usage: umount [OPTION]... DEVICE|DIRECTORY
3440 -a Unmount all file systems
3441 -r Try to remount devices as read-only if mount is busy
3442 -f Force filesystem umount (i.e., unreachable NFS server)
3443 -l Do not free loop device (if a loop device has been used)
3459 <title>uname</title>
3462 Usage: uname [OPTION]...
3466 Print certain system information. With no OPTION, same
3476 -a Print all information
3477 -m Print the machine (hardware) type
3478 -n Print the machine's network node hostname
3479 -r Print the operating system release
3480 -s Print the operating system name
3481 -p Print the host processor type
3482 -v Print the operating system version
3493 Linux debian 2.2.15pre13 #5 Tue Mar 14 16:03:50 MST 2000 i686 unknown
3502 Usage: uniq [INPUT [OUTPUT]]
3506 Discard all but one of successive identical lines from
3507 INPUT (or stdin), writing to OUTPUT (or stdout).
3516 -c prefix lines by the number of occurrences
3517 -d only print duplicate lines
3518 -u only print unique lines
3528 $ echo -e "a\na\nb\nc\nc\na" | sort | uniq
3536 <sect1 id="unix2dos">
3537 <title>unix2dos</title>
3540 Usage: unix2dos < unixfile > dosfile
3544 Converts a text file from unix format to dos format.
3550 <title>unrpm</title>
3553 Usage: unrpm < package.rpm | gzip -d | cpio -idmuv
3557 Extracts an rpm archive.
3563 <title>update</title>
3566 Usage: update [OPTION]...
3570 Periodically flush filesystem buffers.
3579 -S Force use of sync(2) instead of flushing
3580 -s SECS Call sync this often (default 30)
3581 -f SECS Flush some buffers this often (default 5)
3587 <title>uptime</title>
3594 Display how long the system has been running since boot.
3604 1:55pm up 2:30, load average: 0.09, 0.04, 0.00
3610 <title>usleep</title>
3617 Pause for N microseconds.
3627 [pauses for 1 second]
3632 <sect1 id="uudecode">
3633 <title>uudecode</title>
3636 Usage: uudecode [OPTION] [FILE]
3640 Uudecode a uuencoded file.
3649 -o FILE Direct output to FILE
3659 $ uudecode -o busybox busybox.uu
3661 -rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox
3666 <sect1 id="uuencode">
3667 <title>uuencode</title>
3670 Usage: uuencode [OPTION] [INFILE] OUTFILE
3683 -m Use base64 encoding as of RFC1521
3693 $ uuencode busybox busybox
3695 M?T5,1@$!`0````````````(``P`!````L+@$"#0```!0N@,``````#0`(``&
3697 $ uudecode busybox busybox > busybox.uu
3703 <sect1 id="watchdog">
3704 <title>watchdog</title>
3707 Usage: watchdog device
3711 Periodically writes to watchdog device B<device>.
3719 Usage: wc [OPTION]... [FILE]...
3723 Print line, word, and byte counts for each FILE, and a
3724 total line if more than one FILE is specified. With no
3734 -c Print the byte counts
3735 -l Print the newline counts
3736 -L Print the length of the longest line
3737 -w Print the word counts
3748 31 46 1365 /etc/passwd
3754 <title>which</title>
3757 Usage: which [COMMAND]...
3777 <title>whoami</title>
3784 Print the user name associated with the current
3801 <title>xargs</title>
3804 Usage: xargs [OPTIONS] [COMMAND] [ARGS...]
3808 Executes COMMAND on every item given by standard input.
3817 -t Print the command just before it is run
3829 $ find . -name '*.c' -print | xargs rm
3838 Usage: yes [STRING]...
3842 Repeatedly output a line with all specified STRING(s),
3851 Usage: zcat [OPTION]... FILE
3855 Uncompress FILE (or stdin if FILE is '-') to stdout.
3864 -t Test compressed file integrity
3879 <chapter id="LIBC-NSS">
3880 <title>LIBC NSS</title>
3883 GNU Libc uses the Name Service Switch (NSS) to configure the
3884 behavior of the C library for the local environment, and to
3885 configure how it reads system data, such as passwords and group
3886 information. BusyBox has made it Policy that it will never use
3887 NSS, and will never use libc calls that make use of NSS. This
3888 allows you to run an embedded system without the need for
3889 installing an /etc/nsswitch.conf file and without /lib/libnss_*
3890 libraries installed.
3894 If you are using a system that is using a remote LDAP server for
3895 authentication via GNU libc NSS, and you want to use BusyBox,
3896 then you will need to adjust the BusyBox source. Chances are
3897 though, that if you have enough space to install of that stuff
3898 on your system, then you probably want the full GNU utilities.
3902 <chapter id="SEE-ALSO">
3903 <title>SEE ALSO</title>
3906 <literal>textutils(1),</literal>
3907 <literal>shellutils(1),</literal>
3912 <chapter id="MAINTAINER">
3913 <title>MAINTAINER</title>
3916 Erik Andersen <andersee@debian.org> <andersen@lineo.com>
3920 <chapter id="AUTHORS">
3921 <title>AUTHORS</title>
3924 The following people have made significant contributions to
3925 BusyBox -- whether they know it or not.
3929 Erik Andersen <andersee@debian.org>
3933 Edward Betts <edward@debian.org>
3937 John Beppu <beppu@lineo.com>
3941 Brian Candler <B.Candler@pobox.com>
3945 Randolph Chung <tausq@debian.org>
3949 Dave Cinege <dcinege@psychosis.com>
3953 Karl M. Hegbloom <karlheg@debian.org>
3957 Daniel Jacobowitz <dan@debian.org>
3961 Matt Kraai <kraai@alumni.carnegiemellon.edu>
3965 John Lombardo <john@deltanet.com>
3969 Glenn McGrath <bug1@netconnect.com.au>
3973 Bruce Perens <bruce@perens.com>
3977 Chip Rosenthal <chip@unicom.com>, <crosenth@covad.com>
3981 Pavel Roskin <proski@gnu.org>
3985 Gyepi Sam <gyepi@praxis-sw.com>
3989 Linus Torvalds <torvalds@transmeta.com>
3993 Mark Whitley <markw@lineo.com>
3997 Charles P. Wright <cpwright@villagenet.com>
4001 Enrique Zanardi <ezanardi@ull.es>
4005 Vladimir Oleynik <dzo@simtreas.ru>
4010 </book> <!-- End of the book -->