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">
80 When you create a link to BusyBox for the function you wish to use, when
81 BusyBox is called using that link it will behave as if the command itself
97 will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiled
102 You can also invoke BusyBox by issuing the command as an argument on the
103 command line. For example, entering
113 will also cause BusyBox to behave as 'ls'.
118 <sect1 id="Common options">
120 Most BusyBox commands support the <emphasis>--help</emphasis> option to provide
121 a terse runtime description of their behavior.
126 <chapter id="Commands">
127 <title>BusyBox Commands</title>
128 <sect1 id="Available BusyBox Commands">
129 <title>Available BusyBox Commands</title>
131 Currently defined functions include:
135 ar, basename, cat, chgrp, chmod, chown, chroot, chvt, clear,
136 cp, cut, date, dc, dd, deallocvt, df, dirname, dmesg, du,
137 dumpkmap, dutmp, echo, false, fbset, fdflush, find, free,
138 freeramdisk, fsck.minix, grep, gunzip, gzip, halt, head,
139 hostid, hostname, id, init, insmod, kill, killall, length, ln,
140 loadacm, loadfont, loadkmap, logger, logname, ls, lsmod,
141 makedevs, mkdir, mkfifo, mkfs.minix, mknod, mkswap, mktemp,
142 more, mount, mt, mv, nc, nslookup, ping, poweroff, printf, ps,
143 pwd, reboot, renice, reset, rm, rmdir, rmmod, sed, setkeycodes, sh, sleep,
144 sort, swapoff, swapon, sync, syslogd, tail, tar, tee, telnet,
145 test, touch, tr, true, tty, umount, uname, uniq, update,
146 uptime, usleep, uudecode, uuencode, wc, which, whoami, yes,
155 Usage: ar [OPTION] archive [FILENAME]...
159 Extract or list files from an ar archive.
168 o Preserve original dates
172 v Verbosely list files processed
177 <sect1 id="basename">
178 <title>basename</title>
180 Usage: basename FILE [SUFFIX]
184 Strip directory path and suffixes from FILE. If specified, also removes
194 $ basename /usr/local/bin/foo
196 $ basename /usr/local/bin/
198 $ basename /foo/bar.txt .txt
212 Concatenate <literal>FILE(s)</literal> and prints them to the standard
232 Usage: chgrp [OPTION]... GROUP FILE...
236 Change the group membership of each FILE to GROUP.
245 -R Change files and directories recursively
256 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
257 $ chgrp root /tmp/foo
259 -r--r--r-- 1 andersen root 0 Apr 12 18:25 /tmp/foo
268 Usage: chmod [<emphasis>-R</emphasis>] MODE[,MODE]... FILE...
272 Change file access permissions for the specified
273 <literal>FILE(s)</literal> (or directories). Each MODE is defined by
274 combining the letters for WHO has access to the file, an OPERATOR for
275 selecting how the permissions should be changed, and a PERMISSION for
276 <literal>FILE(s)</literal> (or directories).
280 WHO may be chosen from
285 u User who owns the file
286 g Users in the file's Group
287 o Other users not in the file's group
293 OPERATOR may be chosen from
299 - Remove a permission
300 = Assign a permission
305 PERMISSION may be chosen from
312 x Execute (or access for directories)
313 s Set user (or group) ID bit
314 t Sticky bit (for directories prevents removing files by non-owners)
319 Alternately, permissions can be set numerically where the first three
320 numbers are calculated by adding the octal values, such as
332 An optional fourth digit can also be used to specify
349 -R Change files and directories recursively.
360 -rw-rw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo
363 -rwxrw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo*
366 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
374 Usage: chown [OPTION]... OWNER[<.|:>[GROUP] FILE...
378 Change the owner and/or group of each FILE to OWNER and/or GROUP.
387 -R Change files and directories recursively
398 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
399 $ chown root /tmp/foo
401 -r--r--r-- 1 root andersen 0 Apr 12 18:25 /tmp/foo
402 $ chown root.root /tmp/foo
404 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
410 <title>chroot</title>
412 Usage: chroot NEWROOT [COMMAND...]
416 Run COMMAND with root directory set to NEWROOT.
426 lrwxrwxrwx 1 root root 12 Apr 13 00:46 /bin/ls -> /BusyBox
427 $ mount /dev/hdc1 /mnt -t minix
430 -rwxr-xr-x 1 root root 40816 Feb 5 07:45 /bin/ls*
442 Change the foreground virtual terminal to /dev/ttyN
462 Usage: cp [OPTION]... SOURCE DEST
467 or: cp [OPTION]... SOURCE... DIRECTORY
472 Copy SOURCE to DEST, or multiple <literal>SOURCE(s)</literal> to
484 -p Preserve file attributes if possible
485 -R Copy directories recursively
494 Usage: cut [OPTION]... [FILE]...
498 Print selected fields from each input FILE to standard output.
507 -b LIST Output only bytes from LIST
508 -c LIST Output only characters from LIST
509 -d CHAR Use CHAR instead of tab as the field delimiter
510 -s Output only the lines containing delimiter
511 -f N Print only these fields
522 $ echo "Hello world" | cut -f 1 -d ' '
524 $ echo "Hello world" | cut -f 2 -d ' '
534 Usage: date [OPTION]... [+FORMAT]
539 or: date [OPTION] [MMDDhhmm[[CC]YY][.ss]]
544 Display the current time in the given FORMAT, or set the system date.
553 -R Output RFC-822 compliant date string
554 -s Set time described by STRING
555 -u Print or set Coordinated Universal Time
566 Wed Apr 12 18:52:41 MDT 2000
575 Usage: dc [EXPRESSION]
579 This is a Tiny RPN calculator that understands the
580 following operations: +, -, /, *, and, or, not, eor. If
581 no arguments are given, dc will process input from
586 The behaviour of BusyBox/dc deviates (just a little ;-)
587 from GNU/dc, but this will be remedied in the future.
604 $ echo 72 9 div 8 mul | dc
614 Usage: dd [OPTION]...
618 Copy a file, converting and formatting according to
628 if=FILE Read from FILE instead of stdin
629 of=FILE Write to FILE instead of stdout
630 bs=N Read and write N bytes at a time
631 count=N Copy only N input blocks
632 skip=N Skip N input blocks
633 seek=N Skip N output blocks
638 Numbers may be suffixed by w (x2), k (x1024), b (x512),
648 $ dd if=/dev/zero of=/dev/ram1 bs=1M count=4
655 <sect1 id="deallocvt">
656 <title>deallocvt</title>
663 Deallocate unused virtual terminal /dev/ttyN.
675 Print the filesystem space used and space available.
685 Filesystem 1k-blocks Used Available Use% Mounted on
686 /dev/sda3 8690864 8553540 137324 98% /
687 /dev/sda1 64216 36364 27852 57% /boot
689 Filesystem 1k-blocks Used Available Use% Mounted on
690 /dev/sda3 8690864 8553540 137324 98% /
696 <title>dirname</title>
703 Strip non-directory suffix from NAME.
724 Usage: dmesg [OPTION]...
728 Print or control the kernel ring buffer.
737 -c Clear the ring buffer after printing
738 -n LEVEL Set the console logging level to LEVEL
739 -s BUFSIZE Query ring buffer using a buffer of BUFSIZE
748 Usage: du [OPTION]... [FILE]...
752 Summarize the disk space used for each FILE or current
753 directory. Disk space printed in units of 1k (i.e.
763 -l Count sizes many times if hard linked
764 -s Display only a total for each argument
776 12 ./kernel-patches/CVS
789 <sect1 id="dumpkmap">
790 <title>dumpkmap</title>
797 Prints out a binary keyboard translation table to standard input.
809 Dump utmp file format (pipe delimited) from FILE or
819 $ dutmp /var/run/utmp
820 8|7||si|||0|0|0|955637625|760097|0
821 2|0|~|~~|reboot||0|0|0|955637625|782235|0
822 1|20020|~|~~|runlevel||0|0|0|955637625|800089|0
823 8|125||l4|||0|0|0|955637629|998367|0
824 6|245|tty1|1|LOGIN||0|0|0|955637630|998974|0
825 6|246|tty2|2|LOGIN||0|0|0|955637630|999498|0
826 7|336|pts/0|vt00andersen|andersen|:0.0|0|0|0|955637763|0|0
835 Usage: echo [OPTION]... [ARG]...
839 Print ARGs to stdout.
848 -n Suppress trailing newline
849 -e Enable interpretation of escaped characters
850 -E Disable interpretation of escaped characters
860 $ echo "Erik is cool"
862 $ echo -e "Erik\nis\ncool"
866 $ echo "Erik\nis\ncool"
880 Return an exit code of FALSE (1).
900 Usage: fbset [OPTION]... [MODE]
904 Show and modify frame buffer device settings.
913 -h Display option summary
914 -fb DEVICE Operate on DEVICE
915 -db FILE Use FILE for mode database
916 -g XRES YRES VXRES VYRES DEPTH Set all geometry parameters
917 -t PIXCLOCK LEFT RIGHT UPPER LOWER HSLEN VSLEN Set all timing parameters
918 -xres RES Set visible horizontal resolution
919 -yres RES Set visible vertical resolution
931 # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz
932 geometry 1024 768 1024 768 16
933 timings 12714 128 32 16 4 128 4
935 rgba 5/11,6/5,5/0,0/0
942 <title>fdflush</title>
945 Usage: fdflush DEVICE
949 Force floppy disk drive to detect disk change on DEVICE.
957 Usage: find [PATH]... [EXPRESSION]
961 Search for files in a directory hierarchy. The default
962 PATH is the current directory; default EXPRESSION is
967 EXPRESSION may consist of:
972 -follow Dereference symbolic links
973 -name PATTERN File name (leading directories removed) matches PATTERN
974 -print Print the full file name followed by a newline to stdout
984 $ find / -name /etc/passwd
998 Displays the amount of free and used system memory.
1008 total used free shared buffers
1009 Mem: 257628 248724 8904 59644 93124
1010 Swap: 128516 8404 120112
1011 Total: 386144 257128 129016
1016 <sect1 id="freeramdisk">
1017 <title>freeramdisk</title>
1020 Usage: freeramdisk DEVICE
1024 Free all memory used by the ramdisk DEVICE.
1033 $ freeramdisk /dev/ram2
1038 <sect1 id="fsck.minix">
1039 <title>fsck.minix</title>
1042 Usage: fsck.minix [OPTION]... DEVICE
1046 Perform a consistency check on the MINIX filesystem on
1056 -l List all filenames
1057 -r Perform interactive repairs
1058 -a Perform automatic repairs
1060 -s Output super-block information
1061 -m Activate MINIX-like "mode not cleared" warnings
1062 -f Force file system check.
1068 <title>getopt</title>
1071 Usage: getopt [OPTIONS]...
1075 Parse command options
1080 -a, --alternative Allow long options starting with single -\n"
1081 -l, --longoptions=longopts Long options to be recognized\n"
1082 -n, --name=progname The name under which errors are reported\n"
1083 -o, --options=optstring Short options to be recognized\n"
1084 -q, --quiet Disable error reporting by getopt(3)\n"
1085 -Q, --quiet-output No normal output\n"
1086 -s, --shell=shell Set shell quoting conventions\n"
1087 -T, --test Test for getopt(1) version\n"
1088 -u, --unqote Do not quote the output\n"
1101 GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \
1102 -n 'example.busybox' -- "$@"`
1103 if [ $? != 0 ] ; then exit 1 ; fi
1104 eval set -- "$GETOPT"
1107 -a|--a-long) echo "Option a" ; shift ;;
1108 -b|--b-long) echo "Option b, argument \`$2'" ; shift 2 ;;
1111 "") echo "Option c, no argument"; shift 2 ;;
1112 *) echo "Option c, argument \`$2'" ; shift 2 ;;
1114 --) shift ; break ;;
1115 *) echo "Internal error!" ; exit 1 ;;
1126 Usage: grep [OPTIONS]... PATTERN [FILE]...
1130 Search for PATTERN in each FILE or stdin.
1139 -h Suppress the prefixing filename on output
1140 -i Ignore case distinctions
1141 -n Print line number with output lines
1142 -q Be quiet. Returns 0 if result was found, 1 otherwise
1143 -v Select non-matching lines
1148 This version of grep matches full regular expressions.
1157 $ grep root /etc/passwd
1158 root:x:0:0:root:/root:/bin/bash
1159 $ grep ^[rR]oo. /etc/passwd
1160 root:x:0:0:root:/root:/bin/bash
1166 <title>gunzip</title>
1169 Usage: gunzip [OPTION]... FILE
1173 Uncompress FILE (or stdin if FILE is '-').
1182 -c Write output to standard output
1183 -t Test compressed file integrity
1193 $ ls -la /tmp/BusyBox*
1194 -rw-rw-r-- 1 andersen andersen 557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz
1195 $ gunzip /tmp/BusyBox-0.43.tar.gz
1196 $ ls -la /tmp/BusyBox*
1197 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1206 Usage: gzip [OPTION]... FILE
1210 Compress FILE (or stdin if FILE is '-') with maximum
1211 compression to FILE.gz (or stdout if FILE is '-').
1220 -c Write output to standard output
1230 $ ls -la /tmp/BusyBox*
1231 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1232 $ gzip /tmp/BusyBox-0.43.tar
1233 $ ls -la /tmp/BusyBox*
1234 -rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/BusyBox-0.43.tar.gz
1255 Usage: head [OPTION] FILE...
1259 Print first 10 lines of each FILE to standard output.
1260 With more than one FILE, precede each with a header
1261 giving the file name. With no FILE, or when FILE is -,
1262 read standard input.
1271 -n NUM Print first NUM lines instead of first 10
1281 $ head -n 2 /etc/passwd
1282 root:x:0:0:root:/root:/bin/bash
1283 daemon:x:1:1:daemon:/usr/sbin:/bin/sh
1289 <title>hostid</title>
1296 Prints out a unique 32-bit identifier for the current
1297 machine. The 32-bit identifier is intended to be unique
1298 among all UNIX systems in existence.
1302 <sect1 id="hostname">
1303 <title>hostname</title>
1306 Usage: hostname [OPTION]... [HOSTNAME|-F FILE]
1310 Get or set the hostname or DNS domain name. If a
1311 hostname is given (or a file with the -F parameter), the
1312 host name will be set.
1322 -i Addresses for the hostname
1324 -F FILE Use the contents of FILE to specify the hostname
1344 Usage: id [OPTION]... [USERNAME]
1348 Print information for USERNAME or the current user.
1357 -g Print only the group ID
1358 -u Print only the user ID
1359 -r Print the real user ID instead of the effective ID (with -ug)
1370 uid=1000(andersen) gid=1000(andersen)
1383 Init is the parent of all processes.
1387 This version of init is designed to be run only by the
1392 BusyBox init doesn't support multiple runlevels. The
1393 runlevels field of the /etc/inittab file is completely
1394 ignored by BusyBox init. If you want runlevels, use
1399 BusyBox init works just fine without an inittab. If no
1400 inittab is found, it has the following default behavior:
1405 ::sysinit:/etc/init.d/rcS
1411 If it detects that /dev/console is _not_ a serial
1412 console, it will also run:
1417 tty2::askfirst:/bin/sh
1422 If you choose to use an /etc/inittab file, the inittab
1423 entry format is as follows:
1428 <id>:<runlevels>:<action>:<process>
1435 WARNING: This field has a non-traditional
1436 meaning for BusyBox init! The id field is used
1437 by BusyBox init to specify the controlling tty
1438 for the specified process to run on. The
1439 contents of this field are appended to "/dev/"
1440 and used as-is. There is no need for this field
1441 to be unique, although if it isn't you may have
1442 strange results. If this field is left blank,
1443 it is completely ignored. Also note that if
1444 BusyBox detects that a serial console is in use,
1445 then all entries containing non-empty id fields
1446 will _not_ be run. BusyBox init does nothing
1447 with utmp. We don't need no stinkin' utmp.
1452 <title>runlevels</title>
1455 The runlevels field is completely ignored.
1460 <title>action</title>
1463 Valid actions include: sysinit, respawn,
1464 askfirst, wait, once, and ctrlaltdel.
1468 askfirst acts just like respawn, but before
1469 running the specified process it displays the
1470 line "Please press Enter to activate this
1471 console." and then waits for the user to press
1472 enter before starting the specified process.
1476 Unrecognized actions (like initdefault) will
1477 cause init to emit an error message, and then go
1478 along with its business.
1483 <title>process</title>
1486 Specifies the process to be executed and its
1492 Example /etc/inittab file:
1497 # This is run first except when booting in single-user mode.
1499 ::sysinit:/etc/init.d/rcS
1501 # /bin/sh invocations on selected ttys
1503 # Start an "askfirst" shell on the console (whatever that may be)
1505 # Start an "askfirst" shell on /dev/tty2
1506 tty2::askfirst:/bin/sh
1508 # /sbin/getty invocations for selected ttys
1510 tty4::respawn:/sbin/getty 38400 tty4
1511 tty5::respawn:/sbin/getty 38400 tty5
1513 # Example of how to put a getty on a serial line (for a terminal)
1515 #ttyS0::respawn:/sbin/getty -L ttyS0 9600 vt100
1516 #ttyS1::respawn:/sbin/getty -L ttyS1 9600 vt100
1518 # Example how to put a getty on a modem line.
1519 #ttyS2::respawn:/sbin/getty -x0 -s 57600 ttyS2
1521 # Stuff to do before rebooting
1522 ::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1
1523 ::ctrlaltdel:/sbin/swapoff -a > /dev/null 2>&1
1529 <title>insmod</title>
1532 Usage: insmod [OPTION]... MODULE [symbol=value]...
1536 Load MODULE into the kernel.
1545 -f Force module to load into the wrong kernel version.
1546 -k Make module autoclean-able.
1548 -x Do not export externs
1557 Usage: kill [OPTION] PID...
1561 Send a signal (default is SIGTERM) to the specified
1571 -l List all signal names and numbers
1572 -SIG Send signal SIG
1583 252 root root S [apache]
1584 263 www-data www-data S [apache]
1585 264 www-data www-data S [apache]
1586 265 www-data www-data S [apache]
1587 266 www-data www-data S [apache]
1588 267 www-data www-data S [apache]
1594 <sect1 id="killall">
1595 <title>killall</title>
1598 Usage: killall [OPTION] NAME...
1602 Send a signal (default is SIGTERM) to the specified
1612 -l List all signal names and numbers
1613 -SIG Send signal SIG
1629 <title>length</title>
1632 Usage: length STRING
1636 Print the length of STRING.
1655 Usage: ln [OPTION]... TARGET FILE|DIRECTORY
1659 Create a link named FILE or DIRECTORY to the specified
1660 TARGET. You may use '--' to indicate that all following
1661 arguments are non-options.
1670 -s Make symbolic link instead of hard link
1671 -f Remove existing destination file
1681 $ ln -s BusyBox /tmp/ls
1683 lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -> BusyBox*
1688 <sect1 id="loadacm">
1689 <title>loadacm</title>
1696 Load an acm from stdin.
1705 $ loadacm < /etc/i18n/acmname
1710 <sect1 id="loadfont">
1711 <title>loadfont</title>
1718 Load a console font from stdin.
1727 $ loadfont < /etc/i18n/fontname
1732 <sect1 id="loadkmap">
1733 <title>loadkmap</title>
1740 Load a binary keyboard translation table from stdin.
1749 $ loadkmap < /etc/i18n/lang-keymap
1755 <title>logger</title>
1758 Usage: logger [OPTION]... [MESSAGE]
1762 Write MESSAGE to the system log. If MESSAGE is '-', log
1772 -s Log to stderr as well as the system log
1773 -t Log using the specified tag (defaults to user name)
1774 -p Enter the message with the specified priority
1775 This may be numerical or a ``facility.level'' pair
1790 <sect1 id="logname">
1791 <title>logname</title>
1798 Print the name of the current user.
1817 Usage: ls [OPTION]... [FILE]...
1830 -a Do not hide entries starting with .
1831 -c With -l: show ctime (the time of last
1832 modification of file status information)
1833 -d List directory entries instead of contents
1834 -e List both full date and full time
1835 -l Use a long listing format
1836 -n List numeric UIDs and GIDs instead of names
1837 -p Append indicator (one of /=@|) to entries
1838 -u With -l: show access time (the time of last
1840 -x List entries by lines instead of by columns
1841 -A Do not list implied . and ..
1842 -C List entries by columns
1843 -F Append indicator (one of */=@|) to entries
1844 -R List subdirectories recursively
1859 <title>lsmod</title>
1866 List currently loaded kernel modules.
1870 <sect1 id="makedevs">
1871 <title>makedevs</title>
1874 Usage: makedevsf NAME TYPE MAJOR MINOR FIRST LAST [s]
1878 Create a range of block or character special files.
1887 b Make a block (buffered) device
1888 c or u Make a character (un-buffered) device
1889 p Make a named pipe. MAJOR and MINOR are ignored for named pipes
1894 FIRST specifies the number appended to NAME to create
1895 the first device. LAST specifies the number of the last
1896 item that should be created. If 's' is the last
1897 argument, the base device is created as well.
1906 $ makedevs /dev/ttyS c 4 66 2 63
1907 [creates ttyS2-ttyS63]
1908 $ makedevs /dev/hda b 3 0 0 8 s
1909 [creates hda,hda1-hda8]
1915 <title>md5sum</title>
1918 Usage: md5sum [OPTION]... FILE...
1922 Print or check MD5 checksums.
1931 -b Read files in binary mode
1932 -c Check MD5 sums against given list
1933 -t Read files in text mode (default)
1939 The following two options are useful only when verifying
1945 -s Don't output anything, status code shows success
1946 -w Warn about improperly formated MD5 checksum lines
1957 6fd11e98b98a58f64ff3398d7b324003 busybox
1959 6fd11e98b98a58f64ff3398d7b324003 busybox
1960 6fd11e98b98a58f64ff3398d7b324002 busybox
1961 md5sum: MD5 check failed for 'busybox'
1968 <title>mkdir</title>
1971 Usage: mkdir [OPTION]... DIRECTORY...
1975 Create the DIRECTORY(s), if they do not already exist.
1984 -m Set permission mode (as in chmod), not rwxrwxrwx - umask
1985 -p No error if directory exists, make parent directories as needed
1997 /tmp/foo: File exists
1998 $ mkdir /tmp/foo/bar/baz
1999 /tmp/foo/bar/baz: No such file or directory
2000 $ mkdir -p /tmp/foo/bar/baz
2006 <title>mkfifo</title>
2009 Usage: mkfifo [OPTION] NAME
2013 Create a named pipe (identical to 'mknod NAME p').
2022 -m MODE Create the pipe using the specified mode (default a=rw)
2027 <sect1 id="mkfs.minix">
2028 <title>mkfs.minix</title>
2031 Usage: mkfs.minix [OPTION]... NAME [BLOCKS]
2035 Make a MINIX filesystem.
2044 -c Check the device for bad blocks
2045 -n [14|30] Specify the maximum length of filenames
2046 -i Specify the number of inodes for the filesystem
2047 -l FILENAME Read the bad blocks list from FILENAME
2048 -v Make a Minix version 2 filesystem
2054 <title>mknod</title>
2057 Usage: mknod [OPTION]... NAME TYPE MAJOR MINOR
2061 Create a special file (block, character, or pipe).
2070 -m Create the special file using the specified mode (default a=rw)
2080 b Make a block (buffered) device
2081 c or u Make a character (un-buffered) device
2082 p Make a named pipe. MAJOR and MINOR are ignored for named pipes
2092 $ mknod /dev/fd0 b 2 0
2093 $ mknod -m 644 /tmp/pipe p
2099 <title>mkswap</title>
2102 Usage: mkswap [OPTION]... DEVICE [BLOCKS]
2106 Prepare a disk partition to be used as a swap partition.
2115 -c Check for read-ability.
2116 -v0 Make version 0 swap [max 128 Megs].
2117 -v1 Make version 1 swap [big!] (default for kernels > 2.1.117).
2118 BLOCKS Number of block to use (default is entire partition).
2124 <title>mktemp</title>
2127 Usage: mktemp TEMPLATE
2131 Creates a temporary file with its name based on
2132 TEMPLATE. TEMPLATE is any name with six `Xs' (i.e.
2142 $ mktemp /tmp/temp.XXXXXX
2144 $ ls -la /tmp/temp.mWiLjM
2145 -rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM
2154 Usage: more [FILE]...
2158 Page through text one screenful at a time.
2173 <title>mount</title>
2176 Usage: mount [OPTION]...
2181 or: mount [OPTION]... DEVICE DIRECTORY
2195 -a Mount all filesystems in /etc/fstab
2196 -o One of the many filesystem options listed below
2197 -r Mount the filesystem read-only
2198 -t TYPE Specify the filesystem type
2199 -w Mount the filesystem read-write
2204 Options for use with the -o flag:
2209 async/sync Writes are asynchronous / synchronous
2210 atime/noatime Enable / disable updates to inode access times
2211 dev/nodev Allow / disallow use of special device files
2212 exec/noexec Allow / disallow use of executable files
2213 loop Mount a file via loop device
2214 suid/nosuid Allow / disallow set-user-id-root programs
2215 remount Remount a currently mounted filesystem
2216 ro/rw Mount filesystem read-only / read-write
2221 There are even more flags that are filesystem specific.
2222 You'll have to see the written documentation for those.
2232 /dev/hda3 on / type minix (rw)
2233 proc on /proc type proc (rw)
2234 devpts on /dev/pts type devpts (rw)
2235 $ mount /dev/fd0 /mnt -t msdos -o ro
2236 $ mount /tmp/diskimage /opt -t ext2 -o loop
2245 Usage: mt [OPTION] OPCODE VALUE
2249 Control magnetic tape drive operation.
2258 -f DEVICE Control DEVICE
2267 Usage: mv SOURCE DEST
2272 or: mv SOURCE... DIRECTORY
2277 Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
2286 $ mv /tmp/foo /bin/bar
2299 Open a pipe to HOST:PORT.
2308 $ nc foobar.somedomain.com 25
2309 220 foobar ESMTP Exim 3.12 #1 Sat, 15 Apr 2000 00:03:02 -0600
2311 214-Commands supported:
2312 214- HELO EHLO MAIL RCPT DATA AUTH
2313 214 NOOP QUIT RSET HELP
2315 221 foobar closing connection
2320 <sect1 id="nslookup">
2321 <title>nslookup</title>
2324 Usage: nslookup [HOST]
2328 Query the nameserver for the IP address of the given
2338 $ nslookup localhost
2352 Usage: ping [OPTION]... HOST
2356 Send ICMP ECHO_REQUEST packets to HOST.
2365 -c COUNT Send only COUNT pings
2366 -s SIZE Send SIZE data bytes in packets (default=56)
2367 -q Quiet mode, only displays output at start and when finished
2378 PING slag (127.0.0.1): 56 data bytes
2379 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=20.1 ms
2381 --- debian ping statistics ---
2382 1 packets transmitted, 1 packets received, 0% packet loss
2383 round-trip min/avg/max = 20.1/20.1/20.1 ms
2388 <sect1 id="poweroff">
2389 <title>poweroff</title>
2396 Shut down the system, and request that the kernel turn
2397 off power upon halting.
2402 <title>printf</title>
2405 Usage: printf FORMAT [ARGUMENT]...
2409 Format and print the given data in a manner similar to
2410 the C printf command.
2419 $ printf "Val=%d\n" 5
2433 Report process status. This version of ps accepts no
2453 PID Uid Gid State Command
2455 2 root root S [kflushd]
2456 3 root root S [kupdate]
2457 4 root root S [kpiod]
2458 5 root root S [kswapd]
2459 742 andersen andersen S [bash]
2460 743 andersen andersen S -bash
2461 745 root root S [getty]
2462 2990 andersen andersen R ps
2475 Print the full filename of the current working
2492 <title>rdate</title>
2495 Usage: rdate [OPTION] HOST
2499 Get and possibly set the system date and time from a remote HOST.
2508 -s Set the system date and time (default).
2509 -p Print the date and time.
2515 <title>reboot</title>
2527 <title>renice</title>
2530 Usage: renice priority pid [pid ...]
2534 Changes priority of running processes. Allowed priorities range
2535 from 20 (the process runs only when nothing else is running) to 0
2536 (default priority) to -20 (almost nothing else ever gets to run).
2541 <title>reset</title>
2556 Usage: rm [OPTION]... FILE...
2560 Remove (unlink) the FILE(s). You may use '--' to
2561 indicate that all following arguments are non-options.
2570 -f Remove existing destinations, never prompt
2571 -r or -R Remove the contents of directories recursively
2587 <title>rmdir</title>
2590 Usage: rmdir DIRECTORY...
2594 Remove DIRECTORY(s) if they are empty.
2609 <title>rmmod</title>
2612 Usage: rmmod [OPTION]... [MODULE]...
2616 Unload MODULE(s) from the kernel.
2625 -a Try to remove all unused kernel modules
2644 Usage: sed [OPTION]... SCRIPT [FILE]...
2648 Allowed sed scripts come in the following form:
2663 NUMBER Match specified line number
2665 /REGEXP/ Match specified regexp
2670 ! inverts the meaning of the match
2679 s/regexp/replacement/[igp]
2680 which attempt to match regexp against the pattern space
2681 and if successful replaces the matched portion with replacement.
2683 which appends TEXT after the pattern space
2688 This version of sed matches full regular expressions.
2697 -e Add the script to the commands to be executed
2698 -n Suppress automatic printing of pattern space
2708 $ echo "foo" | sed -e 's/f[a-zA-Z]o/bar/g'
2714 <sect1 id="setkeycodes">
2715 <title>setkeycodes</title>
2718 Usage: setkeycodes SCANCODE KEYCODE ...
2722 Set entries into the kernel's scancode-to-keycode map,
2723 allowing unusual keyboards to generate usable keycodes.
2727 SCANCODE may be either xx or e0xx (hexadecimal), and
2728 KEYCODE is given in decimal.
2737 $ setkeycodes e030 127
2751 lash -- the BusyBox LAme SHell (command interpreter)
2755 This command does not yet have proper documentation.
2759 Use lash just as you would use any other shell. It
2760 properly handles pipes, redirects, job control, can be
2761 used as the shell for scripts (#!/bin/sh), and has a
2762 sufficient set of builtins to do what is needed. It does
2763 not (yet) support Bourne Shell syntax. If you need
2764 things like ``if-then-else'', ``while'', and such, use
2765 ash or bash. If you just need a very simple and
2766 extremely small shell, this will do the job.
2771 <title>sleep</title>
2778 Pause for N seconds.
2788 [2 second delay results]
2797 Usage: sort [OPTION]... [FILE]...
2801 Sort lines of text in FILE(s).
2810 -n Compare numerically
2811 -r Reverse after sorting
2821 $ echo -e "e\nf\nb\nd\nc\na" | sort
2832 <sect1 id="swapoff">
2833 <title>swapoff</title>
2836 Usage: swapoff [OPTION] [DEVICE]
2840 Stop swapping virtual memory pages on DEVICE.
2849 -a Stop swapping on all swap devices
2855 <title>swapon</title>
2858 Usage: swapon [OPTION] [DEVICE]
2862 Start swapping virtual memory pages on the given device.
2871 -a Start swapping on all swap devices
2884 Write all buffered filesystem blocks to disk.
2888 <sect1 id="syslogd">
2889 <title>syslogd</title>
2892 Usage: syslogd [OPTION]...
2896 Linux system and kernel (provides klogd) logging
2897 utility. Note that this version of syslogd/klogd ignores
2907 -m NUM Interval between MARK lines (default=20min, 0=off)
2908 -n Run as a foreground process
2909 -K Do not start up the klogd process
2910 -O FILE Use an alternate log file (default=/var/log/messages)
2911 -R HOST[:PORT] Log messages to HOST on PORT (default=514) over UDP.
2921 $ syslogd -R masterlog:514
2922 $ syslogd -R 192.168.1.1:601
2931 Usage: tail [OPTION] [FILE]...
2935 Print last 10 lines of each FILE to standard output.
2936 With more than one FILE, precede each with a header
2937 giving the file name. With no FILE, or when FILE is -,
2947 -n NUM Print last NUM lines instead of last 10
2948 -f Output data as the file grows. This version
2949 of 'tail -f' supports only one file at a time.
2959 $ tail -n 1 /etc/resolv.conf
2969 Usage: tar [MODE] [OPTION] [FILE]...
2977 MODE may be chosen from
2994 f FILE Use FILE for tarfile (or stdin if '-')
2996 exclude FILE File to exclude
2997 v List files processed
3007 $ zcat /tmp/tarball.tar.gz | tar -xf -
3008 $ tar -cf /tmp/tarball.tar /usr/local
3017 Usage: tee [OPTION]... [FILE]...
3021 Copy stdin to FILE(s), and also to stdout.
3030 -a Append to the given FILEs, do not overwrite
3040 $ echo "Hello" | tee /tmp/foo
3049 <title>telnet</title>
3052 Usage: telnet HOST [PORT]
3056 Establish interactive communication with another
3057 computer over a network using the TELNET protocol.
3062 <title>test, [</title>
3065 Usage: test EXPRESSION
3073 Check file types and compare values returning an exit
3074 code determined by the value of EXPRESSION.
3100 <title>touch</title>
3103 Usage: touch [OPTION]... FILE...
3107 Update the last-modified date on (or create) FILE(s).
3116 -c Do not create files
3127 /bin/ls: /tmp/foo: No such file or directory
3130 -rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo
3139 Usage: tr [OPTION]... STRING1 [STRING2]
3143 Translate, squeeze, and/or delete characters from stdin,
3153 -c Take complement of STRING1
3154 -d Delete input characters coded STRING1
3155 -s Squeeze multiple output characters of STRING2 into one character
3165 $ echo "gdkkn vnqkc" | tr [a-y] [b-z]
3179 Return an exit code of TRUE (1).
3203 Print the file name of the terminal connected to stdin.
3212 -s Print nothing, only return an exit status
3229 <title>umount</title>
3232 Usage: umount [OPTION]... DEVICE|DIRECTORY
3245 -a Unmount all file systems
3246 -r Try to remount devices as read-only if mount is busy
3247 -f Force filesystem umount (i.e. unreachable NFS server)
3248 -l Do not free loop device (if a loop device has been used)
3264 <title>uname</title>
3267 Usage: uname [OPTION]...
3271 Print certain system information. With no OPTION, same
3281 -a Print all information
3282 -m Print the machine (hardware) type
3283 -n Print the machine's network node hostname
3284 -r Print the operating system release
3285 -s Print the operating system name
3286 -p Print the host processor type
3287 -v Print the operating system version
3298 Linux debian 2.2.15pre13 #5 Tue Mar 14 16:03:50 MST 2000 i686 unknown
3307 Usage: uniq [INPUT [OUTPUT]]
3311 Discard all but one of successive identical lines from
3312 INPUT (or stdin), writing to OUTPUT (or stdout).
3321 $ echo -e "a\na\nb\nc\nc\na" | sort | uniq
3330 <title>update</title>
3333 Usage: update [OPTION]...
3337 Periodically flush filesystem buffers.
3346 -S Force use of sync(2) instead of flushing
3347 -s SECS Call sync this often (default 30)
3348 -f SECS Flush some buffers this often (default 5)
3354 <title>uptime</title>
3361 Display how long the system has been running since boot.
3371 1:55pm up 2:30, load average: 0.09, 0.04, 0.00
3377 <title>usleep</title>
3384 Pause for N microseconds.
3394 [pauses for 1 second]
3399 <sect1 id="uudecode">
3400 <title>uudecode</title>
3403 Usage: uudecode [OPTION] [FILE]
3407 Uudecode a uuencoded file.
3416 -o FILE Direct output to FILE
3426 $ uudecode -o busybox busybox.uu
3428 -rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox
3433 <sect1 id="uuencode">
3434 <title>uuencode</title>
3437 Usage: uuencode [OPTION] [INFILE] OUTFILE
3450 -m Use base64 encoding as of RFC1521
3460 $ uuencode busybox busybox
3462 M?T5,1@$!`0````````````(``P`!````L+@$"#0```!0N@,``````#0`(``&
3464 $ uudecode busybox busybox > busybox.uu
3474 Usage: wc [OPTION]... [FILE]...
3478 Print line, word, and byte counts for each FILE, and a
3479 total line if more than one FILE is specified. With no
3489 -c Print the byte counts
3490 -l Print the newline counts
3491 -L Print the length of the longest line
3492 -w Print the word counts
3503 31 46 1365 /etc/passwd
3509 <title>which</title>
3512 Usage: which [COMMAND]...
3532 <title>whoami</title>
3539 Print the user name associated with the current
3559 Usage: yes [STRING]...
3563 Repeatedly output a line with all specified STRING(s),
3572 Usage: zcat [OPTION]... FILE
3576 Uncompress FILE (or stdin if FILE is '-') to stdout.
3585 -t Test compressed file integrity
3600 <chapter id="LIBC-NSS">
3601 <title>LIBC NSS</title>
3604 GNU Libc uses the Name Service Switch (NSS) to configure the
3605 behavior of the C library for the local environment, and to
3606 configure how it reads system data, such as passwords and group
3607 information. BusyBox has made it Policy that it will never use
3608 NSS, and will never use libc calls that make use of NSS. This
3609 allows you to run an embedded system without the need for
3610 installing an /etc/nsswitch.conf file and without /lib/libnss_*
3611 libraries installed.
3615 If you are using a system that is using a remote LDAP server for
3616 authentication via GNU libc NSS, and you want to use BusyBox,
3617 then you will need to adjust the BusyBox source. Chances are
3618 though, that if you have enough space to install of that stuff
3619 on your system, then you probably want the full GNU utilities.
3623 <chapter id="SEE-ALSO">
3624 <title>SEE ALSO</title>
3627 <literal>textutils(1),</literal>
3628 <literal>shellutils(1),</literal>
3633 <chapter id="MAINTAINER">
3634 <title>MAINTAINER</title>
3637 Erik Andersen <andersee@debian.org> <andersen@lineo.com>
3641 <chapter id="AUTHORS">
3642 <title>AUTHORS</title>
3645 The following people have contributed code to BusyBox whether
3646 they know it or not.
3650 Erik Andersen <andersee@debian.org>
3654 John Beppu <beppu@lineo.com>
3658 Brian Candler <B.Candler@pobox.com>
3662 Randolph Chung <tausq@debian.org>
3666 Dave Cinege <dcinege@psychosis.com>
3670 Karl M. Hegbloom <karlheg@debian.org>
3674 John Lombardo <john@deltanet.com>
3678 Glenn McGrath <bug1@netconnect.com.au>
3682 Bruce Perens <bruce@perens.com>
3686 Pavel Roskin <proski@gnu.org>
3690 Linus Torvalds <torvalds@transmeta.com>
3694 Charles P. Wright <cpwright@villagenet.com>
3698 Enrique Zanardi <ezanardi@ull.es>
3701 </book> <!-- End of the book -->