1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
3 <book id="BusyBoxDocumentation">
5 <title>BusyBox - The Swiss Army Knife of Embedded Linux</title>
9 This documentation is free software; you can redistribute
10 it and/or modify it under the terms of the GNU General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later
17 This program is distributed in the hope that it will be
18 useful, but WITHOUT ANY WARRANTY; without even the implied
19 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 See the GNU General Public License for more details.
24 You should have received a copy of the GNU General Public
25 License along with this program; if not, write to the Free
26 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 For more details see the file COPYING in the source
32 distribution of Linux.
38 <chapter id="Introduction">
39 <title>Introduction</title>
42 BusyBox combines tiny versions of many common UNIX utilities into a single
43 small executable. It provides minimalist replacements for most of the
44 utilities you usually find in fileutils, shellutils, findutils, textutils,
45 grep, gzip, tar, etc. BusyBox provides a fairly complete POSIX environment
46 for any small or embedded system. The utilities in BusyBox generally have
47 fewer options than their full-featured GNU cousins; however, the options
48 that are included provide the expected functionality and behave very much
49 like their GNU counterparts.
53 BusyBox has been written with size-optimization and limited resources in
54 mind. It is also extremely modular so you can easily include or exclude
55 commands (or features) at compile time. This makes it easy to customize
56 your embedded systems. To create a working system, just add a kernel, a
57 shell (such as ash), and an editor (such as elvis-tiny or ae).
62 <title>How to use BusyBox</title>
63 <sect1 id="How-to-use-BusyBox">
68 BusyBox <function> [arguments...] # or
74 <function> [arguments...] # if symlinked
79 <sect1 id="Invoking-BusyBox">
80 <title>Invoking BusyBox</title>
83 When you create a link to BusyBox for the function you wish to use, when
84 BusyBox is called using that link it will behave as if the command itself
100 will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiled
105 You can also invoke BusyBox by issuing the command as an argument on the
106 command line. For example, entering
116 will also cause BusyBox to behave as 'ls'.
121 <sect1 id="Common-options">
122 <title>Common options</title>
125 Most BusyBox commands support the <emphasis>--help</emphasis> option to provide
126 a terse runtime description of their behavior.
131 <chapter id="Commands">
132 <title>BusyBox Commands</title>
133 <sect1 id="Available-BusyBox-Commands">
134 <title>Available BusyBox Commands</title>
136 Currently defined functions include:
140 ar, basename, cat, chgrp, chmod, chown, chroot, chvt, clear,
141 cp, cut, date, dc, dd, deallocvt, df, dirname, dmesg, du,
142 dumpkmap, dutmp, echo, false, fbset, fdflush, find, free,
143 freeramdisk, fsck.minix, grep, gunzip, gzip, halt, head,
144 hostid, hostname, id, init, insmod, kill, killall, length, ln,
145 loadacm, loadfont, loadkmap, logger, logname, ls, lsmod,
146 makedevs, mkdir, mkfifo, mkfs.minix, mknod, mkswap, mktemp,
147 more, mount, mt, mv, nc, nslookup, ping, poweroff, printf, ps,
148 pwd, reboot, renice, reset, rm, rmdir, rmmod, sed, setkeycodes, sh, sleep,
149 sort, swapoff, swapon, sync, syslogd, tail, tar, tee, telnet,
150 test, touch, tr, true, tty, umount, uname, uniq, update,
151 uptime, usleep, uudecode, uuencode, wc, which, whoami, yes,
160 Usage: ar [OPTION] archive [FILENAME]...
164 Extract or list files from an ar archive.
173 o Preserve original dates
177 v Verbosely list files processed
182 <sect1 id="basename">
183 <title>basename</title>
185 Usage: basename FILE [SUFFIX]
189 Strip directory path and suffixes from FILE. If specified, also removes
199 $ basename /usr/local/bin/foo
201 $ basename /usr/local/bin/
203 $ basename /foo/bar.txt .txt
217 Concatenate <literal>FILE(s)</literal> and prints them to the standard
237 Usage: chgrp [OPTION]... GROUP FILE...
241 Change the group membership of each FILE to GROUP.
250 -R Change files and directories recursively
261 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
262 $ chgrp root /tmp/foo
264 -r--r--r-- 1 andersen root 0 Apr 12 18:25 /tmp/foo
273 Usage: chmod [<emphasis>-R</emphasis>] MODE[,MODE]... FILE...
277 Change file access permissions for the specified
278 <literal>FILE(s)</literal> (or directories). Each MODE is defined by
279 combining the letters for WHO has access to the file, an OPERATOR for
280 selecting how the permissions should be changed, and a PERMISSION for
281 <literal>FILE(s)</literal> (or directories).
285 WHO may be chosen from
290 u User who owns the file
291 g Users in the file's Group
292 o Other users not in the file's group
298 OPERATOR may be chosen from
304 - Remove a permission
305 = Assign a permission
310 PERMISSION may be chosen from
317 x Execute (or access for directories)
318 s Set user (or group) ID bit
319 t Sticky bit (for directories prevents removing files by non-owners)
324 Alternately, permissions can be set numerically where the first three
325 numbers are calculated by adding the octal values, such as
337 An optional fourth digit can also be used to specify
354 -R Change files and directories recursively.
365 -rw-rw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo
368 -rwxrw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo*
371 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
379 Usage: chown [OPTION]... OWNER[<.|:>[GROUP] FILE...
383 Change the owner and/or group of each FILE to OWNER and/or GROUP.
392 -R Change files and directories recursively
403 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
404 $ chown root /tmp/foo
406 -r--r--r-- 1 root andersen 0 Apr 12 18:25 /tmp/foo
407 $ chown root.root /tmp/foo
409 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
415 <title>chroot</title>
417 Usage: chroot NEWROOT [COMMAND...]
421 Run COMMAND with root directory set to NEWROOT.
431 lrwxrwxrwx 1 root root 12 Apr 13 00:46 /bin/ls -> /BusyBox
432 $ mount /dev/hdc1 /mnt -t minix
435 -rwxr-xr-x 1 root root 40816 Feb 5 07:45 /bin/ls*
447 Change the foreground virtual terminal to /dev/ttyN
467 Usage: cp [OPTION]... SOURCE DEST
472 or: cp [OPTION]... SOURCE... DIRECTORY
477 Copy SOURCE to DEST, or multiple <literal>SOURCE(s)</literal> to
489 -p Preserve file attributes if possible
490 -R Copy directories recursively
499 Usage: cut [OPTION]... [FILE]...
503 Print selected fields from each input FILE to standard output.
512 -b LIST Output only bytes from LIST
513 -c LIST Output only characters from LIST
514 -d CHAR Use CHAR instead of tab as the field delimiter
515 -s Output only the lines containing delimiter
516 -f N Print only these fields
527 $ echo "Hello world" | cut -f 1 -d ' '
529 $ echo "Hello world" | cut -f 2 -d ' '
539 Usage: date [OPTION]... [+FORMAT]
544 or: date [OPTION] [MMDDhhmm[[CC]YY][.ss]]
549 Display the current time in the given FORMAT, or set the system date.
558 -R Output RFC-822 compliant date string
559 -s Set time described by STRING
560 -u Print or set Coordinated Universal Time
571 Wed Apr 12 18:52:41 MDT 2000
580 Usage: dc [EXPRESSION]
584 This is a Tiny RPN calculator that understands the
585 following operations: +, -, /, *, and, or, not, eor. If
586 no arguments are given, dc will process input from
591 The behaviour of BusyBox/dc deviates (just a little ;-)
592 from GNU/dc, but this will be remedied in the future.
609 $ echo 72 9 div 8 mul | dc
619 Usage: dd [OPTION]...
623 Copy a file, converting and formatting according to
633 if=FILE Read from FILE instead of stdin
634 of=FILE Write to FILE instead of stdout
635 bs=N Read and write N bytes at a time
636 count=N Copy only N input blocks
637 skip=N Skip N input blocks
638 seek=N Skip N output blocks
643 Numbers may be suffixed by w (x2), k (x1024), b (x512),
653 $ dd if=/dev/zero of=/dev/ram1 bs=1M count=4
660 <sect1 id="deallocvt">
661 <title>deallocvt</title>
668 Deallocate unused virtual terminal /dev/ttyN.
680 Print the filesystem space used and space available.
690 Filesystem 1k-blocks Used Available Use% Mounted on
691 /dev/sda3 8690864 8553540 137324 98% /
692 /dev/sda1 64216 36364 27852 57% /boot
694 Filesystem 1k-blocks Used Available Use% Mounted on
695 /dev/sda3 8690864 8553540 137324 98% /
701 <title>dirname</title>
708 Strip non-directory suffix from NAME.
729 Usage: dmesg [OPTION]...
733 Print or control the kernel ring buffer.
742 -c Clear the ring buffer after printing
743 -n LEVEL Set the console logging level to LEVEL
744 -s BUFSIZE Query ring buffer using a buffer of BUFSIZE
753 Usage: du [OPTION]... [FILE]...
757 Summarize the disk space used for each FILE or current
758 directory. Disk space printed in units of 1k (i.e.
768 -l Count sizes many times if hard linked
769 -s Display only a total for each argument
781 12 ./kernel-patches/CVS
794 <sect1 id="dumpkmap">
795 <title>dumpkmap</title>
802 Prints out a binary keyboard translation table to standard input.
811 $ dumpkmap < keymap
824 Dump utmp file format (pipe delimited) from FILE or
834 $ dutmp /var/run/utmp
835 8|7||si|||0|0|0|955637625|760097|0
836 2|0|~|~~|reboot||0|0|0|955637625|782235|0
837 1|20020|~|~~|runlevel||0|0|0|955637625|800089|0
838 8|125||l4|||0|0|0|955637629|998367|0
839 6|245|tty1|1|LOGIN||0|0|0|955637630|998974|0
840 6|246|tty2|2|LOGIN||0|0|0|955637630|999498|0
841 7|336|pts/0|vt00andersen|andersen|:0.0|0|0|0|955637763|0|0
850 Usage: echo [OPTION]... [ARG]...
854 Print ARGs to stdout.
863 -n Suppress trailing newline
864 -e Enable interpretation of escaped characters
865 -E Disable interpretation of escaped characters
875 $ echo "Erik is cool"
877 $ echo -e "Erik\nis\ncool"
881 $ echo "Erik\nis\ncool"
891 Usage: expr EXPRESSION
895 Prints the value of EXPRESSION to standard output.
904 ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2
905 ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0
906 ARG1 < ARG2 ARG1 is less than ARG2
907 ARG1 <= ARG2 ARG1 is less than or equal to ARG2
908 ARG1 = ARG2 ARG1 is equal to ARG2
909 ARG1 != ARG2 ARG1 is unequal to ARG2
910 ARG1 >= ARG2 ARG1 is greater than or equal to ARG2
911 ARG1 > ARG2 ARG1 is greater than ARG2
912 ARG1 + ARG2 arithmetic sum of ARG1 and ARG2
913 ARG1 - ARG2 arithmetic difference of ARG1 and ARG2
914 ARG1 * ARG2 arithmetic product of ARG1 and ARG2
915 ARG1 / ARG2 arithmetic quotient of ARG1 divided by ARG2
916 ARG1 % ARG2 arithmetic remainder of ARG1 divided by ARG2
917 STRING : REGEXP anchored pattern match of REGEXP in STRING
918 match STRING REGEXP same as STRING : REGEXP
919 substr STRING POS LENGTH substring of STRING, POS counted from 1
920 index STRING CHARS index in STRING where any CHARS is found, or 0
921 length STRING length of STRING
922 quote TOKEN interpret TOKEN as a string, even if it is a
923 keyword like `match' or an operator like `/'
924 ( EXPRESSION ) value of EXPRESSION
929 Beware that many operators need to be escaped or quoted for shells.
930 Comparisons are arithmetic if both ARGs are numbers, else
931 lexicographical. Pattern matches return the string matched between
932 \( and \) or null; if \( and \) are not used, they return the number
933 of characters matched or 0.
947 Return an exit code of FALSE (1).
967 Usage: fbset [OPTION]... [MODE]
971 Show and modify frame buffer device settings.
980 -h Display option summary
981 -fb DEVICE Operate on DEVICE
982 -db FILE Use FILE for mode database
983 -g XRES YRES VXRES VYRES DEPTH Set all geometry parameters
984 -t PIXCLOCK LEFT RIGHT UPPER LOWER HSLEN VSLEN Set all timing parameters
985 -xres RES Set visible horizontal resolution
986 -yres RES Set visible vertical resolution
998 # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz
999 geometry 1024 768 1024 768 16
1000 timings 12714 128 32 16 4 128 4
1002 rgba 5/11,6/5,5/0,0/0
1008 <sect1 id="fdflush">
1009 <title>fdflush</title>
1012 Usage: fdflush DEVICE
1016 Force floppy disk drive to detect disk change on DEVICE.
1024 Usage: find [PATH]... [EXPRESSION]
1028 Search for files in a directory hierarchy. The default
1029 PATH is the current directory; default EXPRESSION is
1034 EXPRESSION may consist of:
1039 -follow Dereference symbolic links
1040 -name PATTERN File name (leading directories removed) matches PATTERN
1041 -print Print the full file name followed by a newline to stdout
1051 $ find / -name /etc/passwd
1065 Displays the amount of free and used system memory.
1075 total used free shared buffers
1076 Mem: 257628 248724 8904 59644 93124
1077 Swap: 128516 8404 120112
1078 Total: 386144 257128 129016
1083 <sect1 id="freeramdisk">
1084 <title>freeramdisk</title>
1087 Usage: freeramdisk DEVICE
1091 Free all memory used by the ramdisk DEVICE.
1100 $ freeramdisk /dev/ram2
1105 <sect1 id="fsck.minix">
1106 <title>fsck.minix</title>
1109 Usage: fsck.minix [OPTION]... DEVICE
1113 Perform a consistency check on the MINIX filesystem on
1123 -l List all filenames
1124 -r Perform interactive repairs
1125 -a Perform automatic repairs
1127 -s Output super-block information
1128 -m Activate MINIX-like "mode not cleared" warnings
1129 -f Force file system check.
1135 <title>getopt</title>
1138 Usage: getopt [OPTIONS]...
1142 Parse command options
1147 -a, --alternative Allow long options starting with single -\n"
1148 -l, --longoptions=longopts Long options to be recognized\n"
1149 -n, --name=progname The name under which errors are reported\n"
1150 -o, --options=optstring Short options to be recognized\n"
1151 -q, --quiet Disable error reporting by getopt(3)\n"
1152 -Q, --quiet-output No normal output\n"
1153 -s, --shell=shell Set shell quoting conventions\n"
1154 -T, --test Test for getopt(1) version\n"
1155 -u, --unqote Do not quote the output\n"
1168 GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \
1169 -n 'example.busybox' -- "$@"`
1170 if [ $? != 0 ] ; then exit 1 ; fi
1171 eval set -- "$GETOPT"
1174 -a|--a-long) echo "Option a" ; shift ;;
1175 -b|--b-long) echo "Option b, argument \`$2'" ; shift 2 ;;
1178 "") echo "Option c, no argument"; shift 2 ;;
1179 *) echo "Option c, argument \`$2'" ; shift 2 ;;
1181 --) shift ; break ;;
1182 *) echo "Internal error!" ; exit 1 ;;
1193 Usage: grep [OPTIONS]... PATTERN [FILE]...
1197 Search for PATTERN in each FILE or stdin.
1206 -h Suppress the prefixing filename on output
1207 -i Ignore case distinctions
1208 -n Print line number with output lines
1209 -q Be quiet. Returns 0 if result was found, 1 otherwise
1210 -v Select non-matching lines
1215 This version of grep matches full regular expressions.
1224 $ grep root /etc/passwd
1225 root:x:0:0:root:/root:/bin/bash
1226 $ grep ^[rR]oo. /etc/passwd
1227 root:x:0:0:root:/root:/bin/bash
1233 <title>gunzip</title>
1236 Usage: gunzip [OPTION]... FILE
1240 Uncompress FILE (or stdin if FILE is '-').
1249 -c Write output to standard output
1250 -t Test compressed file integrity
1260 $ ls -la /tmp/BusyBox*
1261 -rw-rw-r-- 1 andersen andersen 557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz
1262 $ gunzip /tmp/BusyBox-0.43.tar.gz
1263 $ ls -la /tmp/BusyBox*
1264 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1273 Usage: gzip [OPTION]... FILE
1277 Compress FILE (or stdin if FILE is '-') with maximum
1278 compression to FILE.gz (or stdout if FILE is '-').
1287 -c Write output to standard output
1297 $ ls -la /tmp/BusyBox*
1298 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1299 $ gzip /tmp/BusyBox-0.43.tar
1300 $ ls -la /tmp/BusyBox*
1301 -rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/BusyBox-0.43.tar.gz
1322 Usage: head [OPTION] FILE...
1326 Print first 10 lines of each FILE to standard output.
1327 With more than one FILE, precede each with a header
1328 giving the file name. With no FILE, or when FILE is -,
1329 read standard input.
1338 -n NUM Print first NUM lines instead of first 10
1348 $ head -n 2 /etc/passwd
1349 root:x:0:0:root:/root:/bin/bash
1350 daemon:x:1:1:daemon:/usr/sbin:/bin/sh
1356 <title>hostid</title>
1363 Prints out a unique 32-bit identifier for the current
1364 machine. The 32-bit identifier is intended to be unique
1365 among all UNIX systems in existence.
1369 <sect1 id="hostname">
1370 <title>hostname</title>
1373 Usage: hostname [OPTION]... [HOSTNAME|-F FILE]
1377 Get or set the hostname or DNS domain name. If a
1378 hostname is given (or a file with the -F parameter), the
1379 host name will be set.
1389 -i Addresses for the hostname
1391 -F FILE Use the contents of FILE to specify the hostname
1411 Usage: id [OPTION]... [USERNAME]
1415 Print information for USERNAME or the current user.
1424 -g Print only the group ID
1425 -u Print only the user ID
1426 -r Print the real user ID instead of the effective ID (with -ug)
1437 uid=1000(andersen) gid=1000(andersen)
1450 Init is the parent of all processes.
1454 This version of init is designed to be run only by the
1459 BusyBox init doesn't support multiple runlevels. The
1460 runlevels field of the /etc/inittab file is completely
1461 ignored by BusyBox init. If you want runlevels, use
1466 BusyBox init works just fine without an inittab. If no
1467 inittab is found, it has the following default behavior:
1472 ::sysinit:/etc/init.d/rcS
1478 If it detects that /dev/console is _not_ a serial
1479 console, it will also run:
1484 tty2::askfirst:/bin/sh
1489 If you choose to use an /etc/inittab file, the inittab
1490 entry format is as follows:
1495 <id>:<runlevels>:<action>:<process>
1502 WARNING: This field has a non-traditional
1503 meaning for BusyBox init! The id field is used
1504 by BusyBox init to specify the controlling tty
1505 for the specified process to run on. The
1506 contents of this field are appended to "/dev/"
1507 and used as-is. There is no need for this field
1508 to be unique, although if it isn't you may have
1509 strange results. If this field is left blank,
1510 it is completely ignored. Also note that if
1511 BusyBox detects that a serial console is in use,
1512 then all entries containing non-empty id fields
1513 will _not_ be run. BusyBox init does nothing
1514 with utmp. We don't need no stinkin' utmp.
1519 <title>runlevels</title>
1522 The runlevels field is completely ignored.
1527 <title>action</title>
1530 Valid actions include: sysinit, respawn,
1531 askfirst, wait, once, and ctrlaltdel.
1535 askfirst acts just like respawn, but before
1536 running the specified process it displays the
1537 line "Please press Enter to activate this
1538 console." and then waits for the user to press
1539 enter before starting the specified process.
1543 Unrecognized actions (like initdefault) will
1544 cause init to emit an error message, and then go
1545 along with its business.
1550 <title>process</title>
1553 Specifies the process to be executed and its
1559 <title>Example /etc/inittab file</title>
1563 # This is run first except when booting in single-user mode.
1565 ::sysinit:/etc/init.d/rcS
1567 # /bin/sh invocations on selected ttys
1569 # Start an "askfirst" shell on the console (whatever that may be)
1571 # Start an "askfirst" shell on /dev/tty2
1572 tty2::askfirst:/bin/sh
1574 # /sbin/getty invocations for selected ttys
1576 tty4::respawn:/sbin/getty 38400 tty4
1577 tty5::respawn:/sbin/getty 38400 tty5
1579 # Example of how to put a getty on a serial line (for a terminal)
1581 #ttyS0::respawn:/sbin/getty -L ttyS0 9600 vt100
1582 #ttyS1::respawn:/sbin/getty -L ttyS1 9600 vt100
1584 # Example how to put a getty on a modem line.
1585 #ttyS2::respawn:/sbin/getty -x0 -s 57600 ttyS2
1587 # Stuff to do before rebooting
1588 ::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1
1589 ::ctrlaltdel:/sbin/swapoff -a > /dev/null 2>&1
1596 <title>insmod</title>
1599 Usage: insmod [OPTION]... MODULE [symbol=value]...
1603 Load MODULE into the kernel.
1612 -f Force module to load into the wrong kernel version.
1613 -k Make module autoclean-able.
1615 -x Do not export externs
1624 Usage: kill [OPTION] PID...
1628 Send a signal (default is SIGTERM) to the specified
1638 -l List all signal names and numbers
1639 -SIG Send signal SIG
1650 252 root root S [apache]
1651 263 www-data www-data S [apache]
1652 264 www-data www-data S [apache]
1653 265 www-data www-data S [apache]
1654 266 www-data www-data S [apache]
1655 267 www-data www-data S [apache]
1661 <sect1 id="killall">
1662 <title>killall</title>
1665 Usage: killall [OPTION] NAME...
1669 Send a signal (default is SIGTERM) to the specified
1679 -l List all signal names and numbers
1680 -SIG Send signal SIG
1696 <title>length</title>
1699 Usage: length STRING
1703 Print the length of STRING.
1722 Usage: ln [OPTION]... TARGET FILE|DIRECTORY
1726 Create a link named FILE or DIRECTORY to the specified
1727 TARGET. You may use '--' to indicate that all following
1728 arguments are non-options.
1737 -s Make symbolic link instead of hard link
1738 -f Remove existing destination file
1748 $ ln -s BusyBox /tmp/ls
1750 lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -> BusyBox*
1755 <sect1 id="loadacm">
1756 <title>loadacm</title>
1763 Load an acm from stdin.
1772 $ loadacm < /etc/i18n/acmname
1777 <sect1 id="loadfont">
1778 <title>loadfont</title>
1785 Load a console font from stdin.
1794 $ loadfont < /etc/i18n/fontname
1799 <sect1 id="loadkmap">
1800 <title>loadkmap</title>
1807 Load a binary keyboard translation table from stdin.
1816 $ loadkmap < /etc/i18n/lang-keymap
1822 <title>logger</title>
1825 Usage: logger [OPTION]... [MESSAGE]
1829 Write MESSAGE to the system log. If MESSAGE is '-', log
1839 -s Log to stderr as well as the system log
1840 -t Log using the specified tag (defaults to user name)
1841 -p Enter the message with the specified priority
1842 This may be numerical or a ``facility.level'' pair
1857 <sect1 id="logname">
1858 <title>logname</title>
1865 Print the name of the current user.
1884 Usage: ls [OPTION]... [FILE]...
1897 -a Do not hide entries starting with .
1898 -c With -l: show ctime (the time of last
1899 modification of file status information)
1900 -d List directory entries instead of contents
1901 -e List both full date and full time
1902 -l Use a long listing format
1903 -n List numeric UIDs and GIDs instead of names
1904 -p Append indicator (one of /=@|) to entries
1905 -u With -l: show access time (the time of last
1907 -x List entries by lines instead of by columns
1908 -A Do not list implied . and ..
1909 -C List entries by columns
1910 -F Append indicator (one of */=@|) to entries
1911 -R List subdirectories recursively
1926 <title>lsmod</title>
1933 List currently loaded kernel modules.
1937 <sect1 id="makedevs">
1938 <title>makedevs</title>
1941 Usage: makedevsf NAME TYPE MAJOR MINOR FIRST LAST [s]
1945 Create a range of block or character special files.
1954 b Make a block (buffered) device
1955 c or u Make a character (un-buffered) device
1956 p Make a named pipe. MAJOR and MINOR are ignored for named pipes
1961 FIRST specifies the number appended to NAME to create
1962 the first device. LAST specifies the number of the last
1963 item that should be created. If 's' is the last
1964 argument, the base device is created as well.
1973 $ makedevs /dev/ttyS c 4 66 2 63
1974 [creates ttyS2-ttyS63]
1975 $ makedevs /dev/hda b 3 0 0 8 s
1976 [creates hda,hda1-hda8]
1982 <title>md5sum</title>
1985 Usage: md5sum [OPTION]... FILE...
1989 Print or check MD5 checksums.
1998 -b Read files in binary mode
1999 -c Check MD5 sums against given list
2000 -t Read files in text mode (default)
2006 The following two options are useful only when verifying
2012 -s Don't output anything, status code shows success
2013 -w Warn about improperly formated MD5 checksum lines
2024 6fd11e98b98a58f64ff3398d7b324003 busybox
2026 6fd11e98b98a58f64ff3398d7b324003 busybox
2027 6fd11e98b98a58f64ff3398d7b324002 busybox
2028 md5sum: MD5 check failed for 'busybox'
2035 <title>mkdir</title>
2038 Usage: mkdir [OPTION]... DIRECTORY...
2042 Create the DIRECTORY(s), if they do not already exist.
2051 -m Set permission mode (as in chmod), not rwxrwxrwx - umask
2052 -p No error if directory exists, make parent directories as needed
2064 /tmp/foo: File exists
2065 $ mkdir /tmp/foo/bar/baz
2066 /tmp/foo/bar/baz: No such file or directory
2067 $ mkdir -p /tmp/foo/bar/baz
2073 <title>mkfifo</title>
2076 Usage: mkfifo [OPTION] NAME
2080 Create a named pipe (identical to 'mknod NAME p').
2089 -m MODE Create the pipe using the specified mode (default a=rw)
2094 <sect1 id="mkfs.minix">
2095 <title>mkfs.minix</title>
2098 Usage: mkfs.minix [OPTION]... NAME [BLOCKS]
2102 Make a MINIX filesystem.
2111 -c Check the device for bad blocks
2112 -n [14|30] Specify the maximum length of filenames
2113 -i Specify the number of inodes for the filesystem
2114 -l FILENAME Read the bad blocks list from FILENAME
2115 -v Make a Minix version 2 filesystem
2121 <title>mknod</title>
2124 Usage: mknod [OPTION]... NAME TYPE MAJOR MINOR
2128 Create a special file (block, character, or pipe).
2137 -m Create the special file using the specified mode (default a=rw)
2147 b Make a block (buffered) device
2148 c or u Make a character (un-buffered) device
2149 p Make a named pipe. MAJOR and MINOR are ignored for named pipes
2159 $ mknod /dev/fd0 b 2 0
2160 $ mknod -m 644 /tmp/pipe p
2166 <title>mkswap</title>
2169 Usage: mkswap [OPTION]... DEVICE [BLOCKS]
2173 Prepare a disk partition to be used as a swap partition.
2182 -c Check for read-ability.
2183 -v0 Make version 0 swap [max 128 Megs].
2184 -v1 Make version 1 swap [big!] (default for kernels > 2.1.117).
2185 BLOCKS Number of block to use (default is entire partition).
2191 <title>mktemp</title>
2194 Usage: mktemp TEMPLATE
2198 Creates a temporary file with its name based on
2199 TEMPLATE. TEMPLATE is any name with six `Xs' (i.e.
2209 $ mktemp /tmp/temp.XXXXXX
2211 $ ls -la /tmp/temp.mWiLjM
2212 -rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM
2221 Usage: more [FILE]...
2225 Page through text one screenful at a time.
2240 <title>mount</title>
2243 Usage: mount [OPTION]...
2248 or: mount [OPTION]... DEVICE DIRECTORY
2262 -a Mount all filesystems in /etc/fstab
2263 -o One of the many filesystem options listed below
2264 -r Mount the filesystem read-only
2265 -t TYPE Specify the filesystem type
2266 -w Mount the filesystem read-write
2271 Options for use with the -o flag:
2276 async/sync Writes are asynchronous / synchronous
2277 atime/noatime Enable / disable updates to inode access times
2278 dev/nodev Allow / disallow use of special device files
2279 exec/noexec Allow / disallow use of executable files
2280 loop Mount a file via loop device
2281 suid/nosuid Allow / disallow set-user-id-root programs
2282 remount Remount a currently mounted filesystem
2283 ro/rw Mount filesystem read-only / read-write
2288 There are even more flags that are filesystem specific.
2289 You'll have to see the written documentation for those.
2299 /dev/hda3 on / type minix (rw)
2300 proc on /proc type proc (rw)
2301 devpts on /dev/pts type devpts (rw)
2302 $ mount /dev/fd0 /mnt -t msdos -o ro
2303 $ mount /tmp/diskimage /opt -t ext2 -o loop
2312 Usage: mt [OPTION] OPCODE VALUE
2316 Control magnetic tape drive operation.
2325 -f DEVICE Control DEVICE
2334 Usage: mv SOURCE DEST
2339 or: mv SOURCE... DIRECTORY
2344 Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
2353 $ mv /tmp/foo /bin/bar
2366 Open a pipe to HOST:PORT.
2375 $ nc foobar.somedomain.com 25
2376 220 foobar ESMTP Exim 3.12 #1 Sat, 15 Apr 2000 00:03:02 -0600
2378 214-Commands supported:
2379 214- HELO EHLO MAIL RCPT DATA AUTH
2380 214 NOOP QUIT RSET HELP
2382 221 foobar closing connection
2387 <sect1 id="nslookup">
2388 <title>nslookup</title>
2391 Usage: nslookup [HOST]
2395 Query the nameserver for the IP address of the given
2405 $ nslookup localhost
2419 Usage: ping [OPTION]... HOST
2423 Send ICMP ECHO_REQUEST packets to HOST.
2432 -c COUNT Send only COUNT pings
2433 -s SIZE Send SIZE data bytes in packets (default=56)
2434 -q Quiet mode, only displays output at start and when finished
2445 PING slag (127.0.0.1): 56 data bytes
2446 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=20.1 ms
2448 --- debian ping statistics ---
2449 1 packets transmitted, 1 packets received, 0% packet loss
2450 round-trip min/avg/max = 20.1/20.1/20.1 ms
2455 <sect1 id="poweroff">
2456 <title>poweroff</title>
2463 Shut down the system, and request that the kernel turn
2464 off power upon halting.
2469 <title>printf</title>
2472 Usage: printf FORMAT [ARGUMENT]...
2476 Format and print the given data in a manner similar to
2477 the C printf command.
2486 $ printf "Val=%d\n" 5
2500 Report process status. This version of ps accepts no
2520 PID Uid Gid State Command
2522 2 root root S [kflushd]
2523 3 root root S [kupdate]
2524 4 root root S [kpiod]
2525 5 root root S [kswapd]
2526 742 andersen andersen S [bash]
2527 743 andersen andersen S -bash
2528 745 root root S [getty]
2529 2990 andersen andersen R ps
2542 Print the full filename of the current working
2559 <title>rdate</title>
2562 Usage: rdate [OPTION] HOST
2566 Get and possibly set the system date and time from a remote HOST.
2575 -s Set the system date and time (default).
2576 -p Print the date and time.
2582 <title>reboot</title>
2594 <title>renice</title>
2597 Usage: renice priority pid [pid ...]
2601 Changes priority of running processes. Allowed priorities range
2602 from 20 (the process runs only when nothing else is running) to 0
2603 (default priority) to -20 (almost nothing else ever gets to run).
2608 <title>reset</title>
2623 Usage: rm [OPTION]... FILE...
2627 Remove (unlink) the FILE(s). You may use '--' to
2628 indicate that all following arguments are non-options.
2637 -f Remove existing destinations, never prompt
2638 -r or -R Remove the contents of directories recursively
2654 <title>rmdir</title>
2657 Usage: rmdir DIRECTORY...
2661 Remove DIRECTORY(s) if they are empty.
2676 <title>rmmod</title>
2679 Usage: rmmod [OPTION]... [MODULE]...
2683 Unload MODULE(s) from the kernel.
2692 -a Try to remove all unused kernel modules
2711 Usage: sed [OPTION]... SCRIPT [FILE]...
2715 Allowed sed scripts come in the following form:
2730 NUMBER Match specified line number
2732 /REGEXP/ Match specified regexp
2737 ! inverts the meaning of the match
2746 s/regexp/replacement/[igp]
2747 which attempt to match regexp against the pattern space
2748 and if successful replaces the matched portion with replacement.
2750 which appends TEXT after the pattern space
2755 This version of sed matches full regular expressions.
2764 -e Add the script to the commands to be executed
2765 -n Suppress automatic printing of pattern space
2775 $ echo "foo" | sed -e 's/f[a-zA-Z]o/bar/g'
2781 <sect1 id="setkeycodes">
2782 <title>setkeycodes</title>
2785 Usage: setkeycodes SCANCODE KEYCODE ...
2789 Set entries into the kernel's scancode-to-keycode map,
2790 allowing unusual keyboards to generate usable keycodes.
2794 SCANCODE may be either xx or e0xx (hexadecimal), and
2795 KEYCODE is given in decimal.
2804 $ setkeycodes e030 127
2818 lash -- the BusyBox LAme SHell (command interpreter)
2822 This command does not yet have proper documentation.
2826 Use lash just as you would use any other shell. It
2827 properly handles pipes, redirects, job control, can be
2828 used as the shell for scripts (#!/bin/sh), and has a
2829 sufficient set of builtins to do what is needed. It does
2830 not (yet) support Bourne Shell syntax. If you need
2831 things like ``if-then-else'', ``while'', and such, use
2832 ash or bash. If you just need a very simple and
2833 extremely small shell, this will do the job.
2838 <title>sleep</title>
2845 Pause for N seconds.
2855 [2 second delay results]
2864 Usage: sort [OPTION]... [FILE]...
2868 Sort lines of text in FILE(s).
2877 -n Compare numerically
2878 -r Reverse after sorting
2888 $ echo -e "e\nf\nb\nd\nc\na" | sort
2899 <sect1 id="swapoff">
2900 <title>swapoff</title>
2903 Usage: swapoff [OPTION] [DEVICE]
2907 Stop swapping virtual memory pages on DEVICE.
2916 -a Stop swapping on all swap devices
2922 <title>swapon</title>
2925 Usage: swapon [OPTION] [DEVICE]
2929 Start swapping virtual memory pages on the given device.
2938 -a Start swapping on all swap devices
2951 Write all buffered filesystem blocks to disk.
2955 <sect1 id="syslogd">
2956 <title>syslogd</title>
2959 Usage: syslogd [OPTION]...
2963 Linux system and kernel (provides klogd) logging
2964 utility. Note that this version of syslogd/klogd ignores
2974 -m NUM Interval between MARK lines (default=20min, 0=off)
2975 -n Run as a foreground process
2976 -K Do not start up the klogd process
2977 -O FILE Use an alternate log file (default=/var/log/messages)
2978 -R HOST[:PORT] Log messages to HOST on PORT (default=514) over UDP.
2988 $ syslogd -R masterlog:514
2989 $ syslogd -R 192.168.1.1:601
2998 Usage: tail [OPTION] [FILE]...
3002 Print last 10 lines of each FILE to standard output.
3003 With more than one FILE, precede each with a header
3004 giving the file name. With no FILE, or when FILE is -,
3014 -n NUM Print last NUM lines instead of last 10
3015 -f Output data as the file grows. This version
3016 of 'tail -f' supports only one file at a time.
3026 $ tail -n 1 /etc/resolv.conf
3036 Usage: tar [MODE] [OPTION] [FILE]...
3044 MODE may be chosen from
3061 f FILE Use FILE for tarfile (or stdin if '-')
3063 exclude FILE File to exclude
3064 v List files processed
3074 $ zcat /tmp/tarball.tar.gz | tar -xf -
3075 $ tar -cf /tmp/tarball.tar /usr/local
3084 Usage: tee [OPTION]... [FILE]...
3088 Copy stdin to FILE(s), and also to stdout.
3097 -a Append to the given FILEs, do not overwrite
3107 $ echo "Hello" | tee /tmp/foo
3116 <title>telnet</title>
3119 Usage: telnet HOST [PORT]
3123 Establish interactive communication with another
3124 computer over a network using the TELNET protocol.
3129 <title>test, [</title>
3132 Usage: test EXPRESSION
3140 Check file types and compare values returning an exit
3141 code determined by the value of EXPRESSION.
3167 <title>touch</title>
3170 Usage: touch [OPTION]... FILE...
3174 Update the last-modified date on (or create) FILE(s).
3183 -c Do not create files
3194 /bin/ls: /tmp/foo: No such file or directory
3197 -rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo
3206 Usage: tr [OPTION]... STRING1 [STRING2]
3210 Translate, squeeze, and/or delete characters from stdin,
3220 -c Take complement of STRING1
3221 -d Delete input characters coded STRING1
3222 -s Squeeze multiple output characters of STRING2 into one character
3232 $ echo "gdkkn vnqkc" | tr [a-y] [b-z]
3246 Return an exit code of TRUE (1).
3270 Print the file name of the terminal connected to stdin.
3279 -s Print nothing, only return an exit status
3296 <title>umount</title>
3299 Usage: umount [OPTION]... DEVICE|DIRECTORY
3312 -a Unmount all file systems
3313 -r Try to remount devices as read-only if mount is busy
3314 -f Force filesystem umount (i.e. unreachable NFS server)
3315 -l Do not free loop device (if a loop device has been used)
3331 <title>uname</title>
3334 Usage: uname [OPTION]...
3338 Print certain system information. With no OPTION, same
3348 -a Print all information
3349 -m Print the machine (hardware) type
3350 -n Print the machine's network node hostname
3351 -r Print the operating system release
3352 -s Print the operating system name
3353 -p Print the host processor type
3354 -v Print the operating system version
3365 Linux debian 2.2.15pre13 #5 Tue Mar 14 16:03:50 MST 2000 i686 unknown
3374 Usage: uniq [INPUT [OUTPUT]]
3378 Discard all but one of successive identical lines from
3379 INPUT (or stdin), writing to OUTPUT (or stdout).
3388 $ echo -e "a\na\nb\nc\nc\na" | sort | uniq
3397 <title>update</title>
3400 Usage: update [OPTION]...
3404 Periodically flush filesystem buffers.
3413 -S Force use of sync(2) instead of flushing
3414 -s SECS Call sync this often (default 30)
3415 -f SECS Flush some buffers this often (default 5)
3421 <title>uptime</title>
3428 Display how long the system has been running since boot.
3438 1:55pm up 2:30, load average: 0.09, 0.04, 0.00
3444 <title>usleep</title>
3451 Pause for N microseconds.
3461 [pauses for 1 second]
3466 <sect1 id="uudecode">
3467 <title>uudecode</title>
3470 Usage: uudecode [OPTION] [FILE]
3474 Uudecode a uuencoded file.
3483 -o FILE Direct output to FILE
3493 $ uudecode -o busybox busybox.uu
3495 -rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox
3500 <sect1 id="uuencode">
3501 <title>uuencode</title>
3504 Usage: uuencode [OPTION] [INFILE] OUTFILE
3517 -m Use base64 encoding as of RFC1521
3527 $ uuencode busybox busybox
3529 M?T5,1@$!`0````````````(``P`!````L+@$"#0```!0N@,``````#0`(``&
3531 $ uudecode busybox busybox > busybox.uu
3541 Usage: wc [OPTION]... [FILE]...
3545 Print line, word, and byte counts for each FILE, and a
3546 total line if more than one FILE is specified. With no
3556 -c Print the byte counts
3557 -l Print the newline counts
3558 -L Print the length of the longest line
3559 -w Print the word counts
3570 31 46 1365 /etc/passwd
3576 <title>which</title>
3579 Usage: which [COMMAND]...
3599 <title>whoami</title>
3606 Print the user name associated with the current
3626 Usage: yes [STRING]...
3630 Repeatedly output a line with all specified STRING(s),
3639 Usage: zcat [OPTION]... FILE
3643 Uncompress FILE (or stdin if FILE is '-') to stdout.
3652 -t Test compressed file integrity
3667 <chapter id="LIBC-NSS">
3668 <title>LIBC NSS</title>
3671 GNU Libc uses the Name Service Switch (NSS) to configure the
3672 behavior of the C library for the local environment, and to
3673 configure how it reads system data, such as passwords and group
3674 information. BusyBox has made it Policy that it will never use
3675 NSS, and will never use libc calls that make use of NSS. This
3676 allows you to run an embedded system without the need for
3677 installing an /etc/nsswitch.conf file and without /lib/libnss_*
3678 libraries installed.
3682 If you are using a system that is using a remote LDAP server for
3683 authentication via GNU libc NSS, and you want to use BusyBox,
3684 then you will need to adjust the BusyBox source. Chances are
3685 though, that if you have enough space to install of that stuff
3686 on your system, then you probably want the full GNU utilities.
3690 <chapter id="SEE-ALSO">
3691 <title>SEE ALSO</title>
3694 <literal>textutils(1),</literal>
3695 <literal>shellutils(1),</literal>
3700 <chapter id="MAINTAINER">
3701 <title>MAINTAINER</title>
3704 Erik Andersen <andersee@debian.org> <andersen@lineo.com>
3708 <chapter id="AUTHORS">
3709 <title>AUTHORS</title>
3712 The following people have contributed code to BusyBox whether
3713 they know it or not.
3717 Erik Andersen <andersee@debian.org>
3721 John Beppu <beppu@lineo.com>
3725 Brian Candler <B.Candler@pobox.com>
3729 Randolph Chung <tausq@debian.org>
3733 Dave Cinege <dcinege@psychosis.com>
3737 Karl M. Hegbloom <karlheg@debian.org>
3741 John Lombardo <john@deltanet.com>
3745 Glenn McGrath <bug1@netconnect.com.au>
3749 Bruce Perens <bruce@perens.com>
3753 Pavel Roskin <proski@gnu.org>
3757 Linus Torvalds <torvalds@transmeta.com>
3761 Mark Whitley <markw@lineo.com>
3765 Charles P. Wright <cpwright@villagenet.com>
3769 Enrique Zanardi <ezanardi@ull.es>
3772 </book> <!-- End of the book -->