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 ar, basename, cat, chgrp, chmod, chown, chroot, chvt, clear,
140 cp, cut, date, dc, dd, deallocvt, df, dirname, dmesg, du,
141 dumpkmap, dutmp, echo, false, fbset, fdflush, find, free,
142 freeramdisk, fsck.minix, grep, gunzip, gzip, halt, head,
143 hostid, hostname, id, init, insmod, kill, killall, length, ln,
144 loadacm, loadfont, loadkmap, logger, logname, ls, lsmod,
145 makedevs, mkdir, mkfifo, mkfs.minix, mknod, mkswap, mktemp,
146 more, mount, mt, mv, nc, nslookup, ping, poweroff, printf, ps,
147 pwd, reboot, renice, reset, rm, rmdir, rmmod, sed, setkeycodes, sh, sleep,
148 sort, swapoff, swapon, sync, syslogd, tail, tar, tee, telnet,
149 test, touch, tr, true, tty, umount, uname, uniq, update,
150 uptime, usleep, uudecode, uuencode, wc, which, whoami, yes,
159 Usage: ar [OPTION] archive [FILENAME]...
163 Extract or list files from an ar archive.
172 o Preserve original dates
176 v Verbosely list files processed
181 <sect1 id="basename">
182 <title>basename</title>
184 Usage: basename FILE [SUFFIX]
188 Strip directory path and suffixes from FILE. If specified, also removes
198 $ basename /usr/local/bin/foo
200 $ basename /usr/local/bin/
202 $ basename /foo/bar.txt .txt
216 Concatenate <literal>FILE(s)</literal> and prints them to the standard
236 Usage: chgrp [OPTION]... GROUP FILE...
240 Change the group membership of each FILE to GROUP.
249 -R Change files and directories recursively
260 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
261 $ chgrp root /tmp/foo
263 -r--r--r-- 1 andersen root 0 Apr 12 18:25 /tmp/foo
272 Usage: chmod [<emphasis>-R</emphasis>] MODE[,MODE]... FILE...
276 Change file access permissions for the specified
277 <literal>FILE(s)</literal> (or directories). Each MODE is defined by
278 combining the letters for WHO has access to the file, an OPERATOR for
279 selecting how the permissions should be changed, and a PERMISSION for
280 <literal>FILE(s)</literal> (or directories).
284 WHO may be chosen from
289 u User who owns the file
290 g Users in the file's Group
291 o Other users not in the file's group
297 OPERATOR may be chosen from
303 - Remove a permission
304 = Assign a permission
309 PERMISSION may be chosen from
316 x Execute (or access for directories)
317 s Set user (or group) ID bit
318 t Sticky bit (for directories prevents removing files by non-owners)
323 Alternately, permissions can be set numerically where the first three
324 numbers are calculated by adding the octal values, such as
336 An optional fourth digit can also be used to specify
353 -R Change files and directories recursively.
364 -rw-rw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo
367 -rwxrw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo*
370 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
378 Usage: chown [OPTION]... OWNER[<.|:>[GROUP] FILE...
382 Change the owner and/or group of each FILE to OWNER and/or GROUP.
391 -R Change files and directories recursively
402 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
403 $ chown root /tmp/foo
405 -r--r--r-- 1 root andersen 0 Apr 12 18:25 /tmp/foo
406 $ chown root.root /tmp/foo
408 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
414 <title>chroot</title>
416 Usage: chroot NEWROOT [COMMAND...]
420 Run COMMAND with root directory set to NEWROOT.
430 lrwxrwxrwx 1 root root 12 Apr 13 00:46 /bin/ls -> /BusyBox
431 $ mount /dev/hdc1 /mnt -t minix
434 -rwxr-xr-x 1 root root 40816 Feb 5 07:45 /bin/ls*
446 Change the foreground virtual terminal to /dev/ttyN
466 Usage: cp [OPTION]... SOURCE DEST
471 or: cp [OPTION]... SOURCE... DIRECTORY
476 Copy SOURCE to DEST, or multiple <literal>SOURCE(s)</literal> to
488 -p Preserve file attributes if possible
489 -R Copy directories recursively
498 Usage: cut [OPTION]... [FILE]...
502 Print selected fields from each input FILE to standard output.
511 -b LIST Output only bytes from LIST
512 -c LIST Output only characters from LIST
513 -d CHAR Use CHAR instead of tab as the field delimiter
514 -s Output only the lines containing delimiter
515 -f N Print only these fields
526 $ echo "Hello world" | cut -f 1 -d ' '
528 $ echo "Hello world" | cut -f 2 -d ' '
538 Usage: date [OPTION]... [+FORMAT]
543 or: date [OPTION] [MMDDhhmm[[CC]YY][.ss]]
548 Display the current time in the given FORMAT, or set the system date.
557 -R Output RFC-822 compliant date string
558 -s Set time described by STRING
559 -u Print or set Coordinated Universal Time
570 Wed Apr 12 18:52:41 MDT 2000
579 Usage: dc [EXPRESSION]
583 This is a Tiny RPN calculator that understands the
584 following operations: +, -, /, *, and, or, not, eor. If
585 no arguments are given, dc will process input from
590 The behaviour of BusyBox/dc deviates (just a little ;-)
591 from GNU/dc, but this will be remedied in the future.
608 $ echo 72 9 div 8 mul | dc
618 Usage: dd [OPTION]...
622 Copy a file, converting and formatting according to
632 if=FILE Read from FILE instead of stdin
633 of=FILE Write to FILE instead of stdout
634 bs=N Read and write N bytes at a time
635 count=N Copy only N input blocks
636 skip=N Skip N input blocks
637 seek=N Skip N output blocks
642 Numbers may be suffixed by w (x2), k (x1024), b (x512),
652 $ dd if=/dev/zero of=/dev/ram1 bs=1M count=4
659 <sect1 id="deallocvt">
660 <title>deallocvt</title>
667 Deallocate unused virtual terminal /dev/ttyN.
679 Print the filesystem space used and space available.
689 Filesystem 1k-blocks Used Available Use% Mounted on
690 /dev/sda3 8690864 8553540 137324 98% /
691 /dev/sda1 64216 36364 27852 57% /boot
693 Filesystem 1k-blocks Used Available Use% Mounted on
694 /dev/sda3 8690864 8553540 137324 98% /
700 <title>dirname</title>
707 Strip non-directory suffix from NAME.
728 Usage: dmesg [OPTION]...
732 Print or control the kernel ring buffer.
741 -c Clear the ring buffer after printing
742 -n LEVEL Set the console logging level to LEVEL
743 -s BUFSIZE Query ring buffer using a buffer of BUFSIZE
748 <sect1 id="dos2unix">
749 <title>dos2unix</title>
752 Usage: dos2unix < dosfile > unixfile
756 Converts a text file from dos format to unix format.
765 Usage: du [OPTION]... [FILE]...
769 Summarize the disk space used for each FILE or current
770 directory. Disk space printed in units of 1k (i.e.
780 -l Count sizes many times if hard linked
781 -s Display only a total for each argument
793 12 ./kernel-patches/CVS
806 <sect1 id="dumpkmap">
807 <title>dumpkmap</title>
814 Prints out a binary keyboard translation table to standard input.
823 $ dumpkmap < keymap
836 Dump utmp file format (pipe delimited) from FILE or
846 $ dutmp /var/run/utmp
847 8|7||si|||0|0|0|955637625|760097|0
848 2|0|~|~~|reboot||0|0|0|955637625|782235|0
849 1|20020|~|~~|runlevel||0|0|0|955637625|800089|0
850 8|125||l4|||0|0|0|955637629|998367|0
851 6|245|tty1|1|LOGIN||0|0|0|955637630|998974|0
852 6|246|tty2|2|LOGIN||0|0|0|955637630|999498|0
853 7|336|pts/0|vt00andersen|andersen|:0.0|0|0|0|955637763|0|0
862 Usage: echo [OPTION]... [ARG]...
866 Print ARGs to stdout.
875 -n Suppress trailing newline
876 -e Enable interpretation of escaped characters
877 -E Disable interpretation of escaped characters
887 $ echo "Erik is cool"
889 $ echo -e "Erik\nis\ncool"
893 $ echo "Erik\nis\ncool"
903 Usage: expr EXPRESSION
907 Prints the value of EXPRESSION to standard output.
916 ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2
917 ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0
918 ARG1 < ARG2 ARG1 is less than ARG2
919 ARG1 <= ARG2 ARG1 is less than or equal to ARG2
920 ARG1 = ARG2 ARG1 is equal to ARG2
921 ARG1 != ARG2 ARG1 is unequal to ARG2
922 ARG1 >= ARG2 ARG1 is greater than or equal to ARG2
923 ARG1 > ARG2 ARG1 is greater than ARG2
924 ARG1 + ARG2 arithmetic sum of ARG1 and ARG2
925 ARG1 - ARG2 arithmetic difference of ARG1 and ARG2
926 ARG1 * ARG2 arithmetic product of ARG1 and ARG2
927 ARG1 / ARG2 arithmetic quotient of ARG1 divided by ARG2
928 ARG1 % ARG2 arithmetic remainder of ARG1 divided by ARG2
929 STRING : REGEXP anchored pattern match of REGEXP in STRING
930 match STRING REGEXP same as STRING : REGEXP
931 substr STRING POS LENGTH substring of STRING, POS counted from 1
932 index STRING CHARS index in STRING where any CHARS is found, or 0
933 length STRING length of STRING
934 quote TOKEN interpret TOKEN as a string, even if it is a
935 keyword like `match' or an operator like `/'
936 ( EXPRESSION ) value of EXPRESSION
941 Beware that many operators need to be escaped or quoted for shells.
942 Comparisons are arithmetic if both ARGs are numbers, else
943 lexicographical. Pattern matches return the string matched between
944 \( and \) or null; if \( and \) are not used, they return the number
945 of characters matched or 0.
959 Return an exit code of FALSE (1).
979 Usage: fbset [OPTION]... [MODE]
983 Show and modify frame buffer device settings.
992 -h Display option summary
993 -fb DEVICE Operate on DEVICE
994 -db FILE Use FILE for mode database
995 -g XRES YRES VXRES VYRES DEPTH Set all geometry parameters
996 -t PIXCLOCK LEFT RIGHT UPPER LOWER HSLEN VSLEN Set all timing parameters
997 -xres RES Set visible horizontal resolution
998 -yres RES Set visible vertical resolution
1010 # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz
1011 geometry 1024 768 1024 768 16
1012 timings 12714 128 32 16 4 128 4
1014 rgba 5/11,6/5,5/0,0/0
1020 <sect1 id="fdflush">
1021 <title>fdflush</title>
1024 Usage: fdflush DEVICE
1028 Force floppy disk drive to detect disk change on DEVICE.
1036 Usage: find [PATH]... [EXPRESSION]
1040 Search for files in a directory hierarchy. The default
1041 PATH is the current directory; default EXPRESSION is
1046 EXPRESSION may consist of:
1051 -follow Dereference symbolic links
1052 -name PATTERN File name (leading directories removed) matches PATTERN
1053 -print Print the full file name followed by a newline to stdout
1063 $ find / -name /etc/passwd
1077 Displays the amount of free and used system memory.
1087 total used free shared buffers
1088 Mem: 257628 248724 8904 59644 93124
1089 Swap: 128516 8404 120112
1090 Total: 386144 257128 129016
1095 <sect1 id="freeramdisk">
1096 <title>freeramdisk</title>
1099 Usage: freeramdisk DEVICE
1103 Free all memory used by the ramdisk DEVICE.
1112 $ freeramdisk /dev/ram2
1117 <sect1 id="fsck.minix">
1118 <title>fsck.minix</title>
1121 Usage: fsck.minix [OPTION]... DEVICE
1125 Perform a consistency check on the MINIX filesystem on
1135 -l List all filenames
1136 -r Perform interactive repairs
1137 -a Perform automatic repairs
1139 -s Output super-block information
1140 -m Activate MINIX-like "mode not cleared" warnings
1141 -f Force file system check.
1147 <title>getopt</title>
1150 Usage: getopt [OPTIONS]...
1154 Parse command options
1159 -a, --alternative Allow long options starting with single -\n"
1160 -l, --longoptions=longopts Long options to be recognized\n"
1161 -n, --name=progname The name under which errors are reported\n"
1162 -o, --options=optstring Short options to be recognized\n"
1163 -q, --quiet Disable error reporting by getopt(3)\n"
1164 -Q, --quiet-output No normal output\n"
1165 -s, --shell=shell Set shell quoting conventions\n"
1166 -T, --test Test for getopt(1) version\n"
1167 -u, --unqote Do not quote the output\n"
1180 GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \
1181 -n 'example.busybox' -- "$@"`
1182 if [ $? != 0 ] ; then exit 1 ; fi
1183 eval set -- "$GETOPT"
1186 -a|--a-long) echo "Option a" ; shift ;;
1187 -b|--b-long) echo "Option b, argument \`$2'" ; shift 2 ;;
1190 "") echo "Option c, no argument"; shift 2 ;;
1191 *) echo "Option c, argument \`$2'" ; shift 2 ;;
1193 --) shift ; break ;;
1194 *) echo "Internal error!" ; exit 1 ;;
1205 Usage: grep [OPTIONS]... PATTERN [FILE]...
1209 Search for PATTERN in each FILE or stdin.
1218 -h Suppress the prefixing filename on output
1219 -i Ignore case distinctions
1220 -n Print line number with output lines
1221 -q Be quiet. Returns 0 if result was found, 1 otherwise
1222 -v Select non-matching lines
1227 This version of grep matches full regular expressions.
1236 $ grep root /etc/passwd
1237 root:x:0:0:root:/root:/bin/bash
1238 $ grep ^[rR]oo. /etc/passwd
1239 root:x:0:0:root:/root:/bin/bash
1245 <title>gunzip</title>
1248 Usage: gunzip [OPTION]... FILE
1252 Uncompress FILE (or stdin if FILE is '-').
1261 -c Write output to standard output
1262 -t Test compressed file integrity
1272 $ ls -la /tmp/BusyBox*
1273 -rw-rw-r-- 1 andersen andersen 557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz
1274 $ gunzip /tmp/BusyBox-0.43.tar.gz
1275 $ ls -la /tmp/BusyBox*
1276 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1285 Usage: gzip [OPTION]... FILE
1289 Compress FILE (or stdin if FILE is '-') with maximum
1290 compression to FILE.gz (or stdout if FILE is '-').
1299 -c Write output to standard output
1309 $ ls -la /tmp/BusyBox*
1310 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1311 $ gzip /tmp/BusyBox-0.43.tar
1312 $ ls -la /tmp/BusyBox*
1313 -rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/BusyBox-0.43.tar.gz
1334 Usage: head [OPTION] FILE...
1338 Print first 10 lines of each FILE to standard output.
1339 With more than one FILE, precede each with a header
1340 giving the file name. With no FILE, or when FILE is -,
1341 read standard input.
1350 -n NUM Print first NUM lines instead of first 10
1360 $ head -n 2 /etc/passwd
1361 root:x:0:0:root:/root:/bin/bash
1362 daemon:x:1:1:daemon:/usr/sbin:/bin/sh
1368 <title>hostid</title>
1375 Prints out a unique 32-bit identifier for the current
1376 machine. The 32-bit identifier is intended to be unique
1377 among all UNIX systems in existence.
1381 <sect1 id="hostname">
1382 <title>hostname</title>
1385 Usage: hostname [OPTION]... [HOSTNAME|-F FILE]
1389 Get or set the hostname or DNS domain name. If a
1390 hostname is given (or a file with the -F parameter), the
1391 host name will be set.
1401 -i Addresses for the hostname
1403 -F FILE Use the contents of FILE to specify the hostname
1423 Usage: id [OPTION]... [USERNAME]
1427 Print information for USERNAME or the current user.
1436 -g Print only the group ID
1437 -u Print only the user ID
1438 -r Print the real user ID instead of the effective ID (with -ug)
1449 uid=1000(andersen) gid=1000(andersen)
1462 Init is the parent of all processes.
1466 This version of init is designed to be run only by the
1471 BusyBox init doesn't support multiple runlevels. The
1472 runlevels field of the /etc/inittab file is completely
1473 ignored by BusyBox init. If you want runlevels, use
1478 BusyBox init works just fine without an inittab. If no
1479 inittab is found, it has the following default behavior:
1484 ::sysinit:/etc/init.d/rcS
1490 If it detects that /dev/console is _not_ a serial
1491 console, it will also run:
1496 tty2::askfirst:/bin/sh
1501 If you choose to use an /etc/inittab file, the inittab
1502 entry format is as follows:
1507 <id>:<runlevels>:<action>:<process>
1514 WARNING: This field has a non-traditional
1515 meaning for BusyBox init! The id field is used
1516 by BusyBox init to specify the controlling tty
1517 for the specified process to run on. The
1518 contents of this field are appended to "/dev/"
1519 and used as-is. There is no need for this field
1520 to be unique, although if it isn't you may have
1521 strange results. If this field is left blank,
1522 it is completely ignored. Also note that if
1523 BusyBox detects that a serial console is in use,
1524 then all entries containing non-empty id fields
1525 will _not_ be run. BusyBox init does nothing
1526 with utmp. We don't need no stinkin' utmp.
1531 <title>runlevels</title>
1534 The runlevels field is completely ignored.
1539 <title>action</title>
1542 Valid actions include: sysinit, respawn,
1543 askfirst, wait, once, and ctrlaltdel.
1547 askfirst acts just like respawn, but before
1548 running the specified process it displays the
1549 line "Please press Enter to activate this
1550 console." and then waits for the user to press
1551 enter before starting the specified process.
1555 Unrecognized actions (like initdefault) will
1556 cause init to emit an error message, and then go
1557 along with its business.
1562 <title>process</title>
1565 Specifies the process to be executed and its
1571 <title>Example /etc/inittab file</title>
1575 # This is run first except when booting in single-user mode.
1577 ::sysinit:/etc/init.d/rcS
1579 # /bin/sh invocations on selected ttys
1581 # Start an "askfirst" shell on the console (whatever that may be)
1583 # Start an "askfirst" shell on /dev/tty2-4
1584 tty2::askfirst:-/bin/sh
1585 tty2::askfirst:-/bin/sh
1586 tty2::askfirst:-/bin/sh
1588 # /sbin/getty invocations for selected ttys
1590 tty4::respawn:/sbin/getty 38400 tty5
1591 tty5::respawn:/sbin/getty 38400 tty6
1593 # Example of how to put a getty on a serial line (for a terminal)
1595 #ttyS0::respawn:/sbin/getty -L ttyS0 9600 vt100
1596 #ttyS1::respawn:/sbin/getty -L ttyS1 9600 vt100
1598 # Example how to put a getty on a modem line.
1599 #ttyS2::respawn:/sbin/getty -x0 -s 57600 ttyS2
1601 # Stuff to do before rebooting
1602 ::ctrlaltdel:/bin/umount -a -r
1603 ::ctrlaltdel:/sbin/swapoff
1610 <title>insmod</title>
1613 Usage: insmod [OPTION]... MODULE [symbol=value]...
1617 Load MODULE into the kernel.
1626 -f Force module to load into the wrong kernel version.
1627 -k Make module autoclean-able.
1629 -x Do not export externs
1638 Usage: kill [OPTION] PID...
1642 Send a signal (default is SIGTERM) to the specified
1652 -l List all signal names and numbers
1653 -SIG Send signal SIG
1664 252 root root S [apache]
1665 263 www-data www-data S [apache]
1666 264 www-data www-data S [apache]
1667 265 www-data www-data S [apache]
1668 266 www-data www-data S [apache]
1669 267 www-data www-data S [apache]
1675 <sect1 id="killall">
1676 <title>killall</title>
1679 Usage: killall [OPTION] NAME...
1683 Send a signal (default is SIGTERM) to the specified
1693 -l List all signal names and numbers
1694 -SIG Send signal SIG
1710 <title>length</title>
1713 Usage: length STRING
1717 Print the length of STRING.
1736 Usage: ln [OPTION]... TARGET FILE|DIRECTORY
1740 Create a link named FILE or DIRECTORY to the specified
1741 TARGET. You may use '--' to indicate that all following
1742 arguments are non-options.
1751 -s Make symbolic link instead of hard link
1752 -f Remove existing destination file
1762 $ ln -s BusyBox /tmp/ls
1764 lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -> BusyBox*
1769 <sect1 id="loadacm">
1770 <title>loadacm</title>
1777 Load an acm from stdin.
1786 $ loadacm < /etc/i18n/acmname
1791 <sect1 id="loadfont">
1792 <title>loadfont</title>
1799 Load a console font from stdin.
1808 $ loadfont < /etc/i18n/fontname
1813 <sect1 id="loadkmap">
1814 <title>loadkmap</title>
1821 Load a binary keyboard translation table from stdin.
1830 $ loadkmap < /etc/i18n/lang-keymap
1836 <title>logger</title>
1839 Usage: logger [OPTION]... [MESSAGE]
1843 Write MESSAGE to the system log. If MESSAGE is '-', log
1853 -s Log to stderr as well as the system log
1854 -t Log using the specified tag (defaults to user name)
1855 -p Enter the message with the specified priority
1856 This may be numerical or a ``facility.level'' pair
1871 <sect1 id="logname">
1872 <title>logname</title>
1879 Print the name of the current user.
1898 Usage: ls [OPTION]... [FILE]...
1911 -a Do not hide entries starting with .
1912 -c With -l: show ctime (the time of last
1913 modification of file status information)
1914 -d List directory entries instead of contents
1915 -e List both full date and full time
1916 -l Use a long listing format
1917 -n List numeric UIDs and GIDs instead of names
1918 -p Append indicator (one of /=@|) to entries
1919 -u With -l: show access time (the time of last
1921 -x List entries by lines instead of by columns
1922 -A Do not list implied . and ..
1923 -C List entries by columns
1924 -F Append indicator (one of */=@|) to entries
1925 -R List subdirectories recursively
1940 <title>lsmod</title>
1947 List currently loaded kernel modules.
1951 <sect1 id="makedevs">
1952 <title>makedevs</title>
1955 Usage: makedevsf NAME TYPE MAJOR MINOR FIRST LAST [s]
1959 Create a range of block or character special files.
1968 b Make a block (buffered) device
1969 c or u Make a character (un-buffered) device
1970 p Make a named pipe. MAJOR and MINOR are ignored for named pipes
1975 FIRST specifies the number appended to NAME to create
1976 the first device. LAST specifies the number of the last
1977 item that should be created. If 's' is the last
1978 argument, the base device is created as well.
1987 $ makedevs /dev/ttyS c 4 66 2 63
1988 [creates ttyS2-ttyS63]
1989 $ makedevs /dev/hda b 3 0 0 8 s
1990 [creates hda,hda1-hda8]
1996 <title>md5sum</title>
1999 Usage: md5sum [OPTION]... FILE...
2003 Print or check MD5 checksums.
2012 -b Read files in binary mode
2013 -c Check MD5 sums against given list
2014 -t Read files in text mode (default)
2020 The following two options are useful only when verifying
2026 -s Don't output anything, status code shows success
2027 -w Warn about improperly formated MD5 checksum lines
2038 6fd11e98b98a58f64ff3398d7b324003 busybox
2040 6fd11e98b98a58f64ff3398d7b324003 busybox
2041 6fd11e98b98a58f64ff3398d7b324002 busybox
2042 md5sum: MD5 check failed for 'busybox'
2049 <title>mkdir</title>
2052 Usage: mkdir [OPTION]... DIRECTORY...
2056 Create the DIRECTORY(s), if they do not already exist.
2065 -m Set permission mode (as in chmod), not rwxrwxrwx - umask
2066 -p No error if directory exists, make parent directories as needed
2078 /tmp/foo: File exists
2079 $ mkdir /tmp/foo/bar/baz
2080 /tmp/foo/bar/baz: No such file or directory
2081 $ mkdir -p /tmp/foo/bar/baz
2087 <title>mkfifo</title>
2090 Usage: mkfifo [OPTION] NAME
2094 Create a named pipe (identical to 'mknod NAME p').
2103 -m MODE Create the pipe using the specified mode (default a=rw)
2108 <sect1 id="mkfs.minix">
2109 <title>mkfs.minix</title>
2112 Usage: mkfs.minix [OPTION]... NAME [BLOCKS]
2116 Make a MINIX filesystem.
2125 -c Check the device for bad blocks
2126 -n [14|30] Specify the maximum length of filenames
2127 -i Specify the number of inodes for the filesystem
2128 -l FILENAME Read the bad blocks list from FILENAME
2129 -v Make a Minix version 2 filesystem
2135 <title>mknod</title>
2138 Usage: mknod [OPTION]... NAME TYPE MAJOR MINOR
2142 Create a special file (block, character, or pipe).
2151 -m Create the special file using the specified mode (default a=rw)
2161 b Make a block (buffered) device
2162 c or u Make a character (un-buffered) device
2163 p Make a named pipe. MAJOR and MINOR are ignored for named pipes
2173 $ mknod /dev/fd0 b 2 0
2174 $ mknod -m 644 /tmp/pipe p
2180 <title>mkswap</title>
2183 Usage: mkswap [OPTION]... DEVICE [BLOCKS]
2187 Prepare a disk partition to be used as a swap partition.
2196 -c Check for read-ability.
2197 -v0 Make version 0 swap [max 128 Megs].
2198 -v1 Make version 1 swap [big!] (default for kernels > 2.1.117).
2199 BLOCKS Number of block to use (default is entire partition).
2205 <title>mktemp</title>
2208 Usage: mktemp TEMPLATE
2212 Creates a temporary file with its name based on
2213 TEMPLATE. TEMPLATE is any name with six `Xs' (i.e.
2223 $ mktemp /tmp/temp.XXXXXX
2225 $ ls -la /tmp/temp.mWiLjM
2226 -rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM
2235 Usage: more [FILE]...
2239 Page through text one screenful at a time.
2254 <title>mount</title>
2257 Usage: mount [OPTION]...
2262 or: mount [OPTION]... DEVICE DIRECTORY
2276 -a Mount all filesystems in /etc/fstab
2277 -o One of the many filesystem options listed below
2278 -r Mount the filesystem read-only
2279 -t TYPE Specify the filesystem type
2280 -w Mount the filesystem read-write
2285 Options for use with the -o flag:
2290 async/sync Writes are asynchronous / synchronous
2291 atime/noatime Enable / disable updates to inode access times
2292 dev/nodev Allow / disallow use of special device files
2293 exec/noexec Allow / disallow use of executable files
2294 loop Mount a file via loop device
2295 suid/nosuid Allow / disallow set-user-id-root programs
2296 remount Remount a currently mounted filesystem
2297 ro/rw Mount filesystem read-only / read-write
2302 There are even more flags that are filesystem specific.
2303 You'll have to see the written documentation for those.
2313 /dev/hda3 on / type minix (rw)
2314 proc on /proc type proc (rw)
2315 devpts on /dev/pts type devpts (rw)
2316 $ mount /dev/fd0 /mnt -t msdos -o ro
2317 $ mount /tmp/diskimage /opt -t ext2 -o loop
2326 Usage: mt [OPTION] OPCODE VALUE
2330 Control magnetic tape drive operation.
2339 -f DEVICE Control DEVICE
2348 Usage: mv SOURCE DEST
2353 or: mv SOURCE... DIRECTORY
2358 Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
2367 $ mv /tmp/foo /bin/bar
2380 Open a pipe to HOST:PORT.
2389 $ nc foobar.somedomain.com 25
2390 220 foobar ESMTP Exim 3.12 #1 Sat, 15 Apr 2000 00:03:02 -0600
2392 214-Commands supported:
2393 214- HELO EHLO MAIL RCPT DATA AUTH
2394 214 NOOP QUIT RSET HELP
2396 221 foobar closing connection
2401 <sect1 id="nslookup">
2402 <title>nslookup</title>
2405 Usage: nslookup [HOST]
2409 Query the nameserver for the IP address of the given
2419 $ nslookup localhost
2433 Usage: ping [OPTION]... HOST
2437 Send ICMP ECHO_REQUEST packets to HOST.
2446 -c COUNT Send only COUNT pings
2447 -s SIZE Send SIZE data bytes in packets (default=56)
2448 -q Quiet mode, only displays output at start and when finished
2459 PING slag (127.0.0.1): 56 data bytes
2460 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=20.1 ms
2462 --- debian ping statistics ---
2463 1 packets transmitted, 1 packets received, 0% packet loss
2464 round-trip min/avg/max = 20.1/20.1/20.1 ms
2469 <sect1 id="poweroff">
2470 <title>poweroff</title>
2477 Shut down the system, and request that the kernel turn
2478 off power upon halting.
2483 <title>printf</title>
2486 Usage: printf FORMAT [ARGUMENT]...
2490 Format and print the given data in a manner similar to
2491 the C printf command.
2500 $ printf "Val=%d\n" 5
2514 Report process status. This version of ps accepts no
2534 PID Uid Gid State Command
2536 2 root root S [kflushd]
2537 3 root root S [kupdate]
2538 4 root root S [kpiod]
2539 5 root root S [kswapd]
2540 742 andersen andersen S [bash]
2541 743 andersen andersen S -bash
2542 745 root root S [getty]
2543 2990 andersen andersen R ps
2556 Print the full filename of the current working
2573 <title>rdate</title>
2576 Usage: rdate [OPTION] HOST
2580 Get and possibly set the system date and time from a remote HOST.
2589 -s Set the system date and time (default).
2590 -p Print the date and time.
2596 <title>reboot</title>
2608 <title>renice</title>
2611 Usage: renice priority pid [pid ...]
2615 Changes priority of running processes. Allowed priorities range
2616 from 20 (the process runs only when nothing else is running) to 0
2617 (default priority) to -20 (almost nothing else ever gets to run).
2622 <title>reset</title>
2637 Usage: rm [OPTION]... FILE...
2641 Remove (unlink) the FILE(s). You may use '--' to
2642 indicate that all following arguments are non-options.
2651 -f Remove existing destinations, never prompt
2652 -r or -R Remove the contents of directories recursively
2668 <title>rmdir</title>
2671 Usage: rmdir DIRECTORY...
2675 Remove DIRECTORY(s) if they are empty.
2690 <title>rmmod</title>
2693 Usage: rmmod [OPTION]... [MODULE]...
2697 Unload MODULE(s) from the kernel.
2706 -a Try to remove all unused kernel modules
2725 Usage: sed [OPTION]... SCRIPT [FILE]...
2729 Allowed sed scripts come in the following form:
2744 NUMBER Match specified line number
2746 /REGEXP/ Match specified regexp
2751 ! inverts the meaning of the match
2760 s/regexp/replacement/[igp]
2761 which attempt to match regexp against the pattern space
2762 and if successful replaces the matched portion with replacement.
2764 which appends TEXT after the pattern space
2769 This version of sed matches full regular expressions.
2778 -e Add the script to the commands to be executed
2779 -n Suppress automatic printing of pattern space
2789 $ echo "foo" | sed -e 's/f[a-zA-Z]o/bar/g'
2795 <sect1 id="setkeycodes">
2796 <title>setkeycodes</title>
2799 Usage: setkeycodes SCANCODE KEYCODE ...
2803 Set entries into the kernel's scancode-to-keycode map,
2804 allowing unusual keyboards to generate usable keycodes.
2808 SCANCODE may be either xx or e0xx (hexadecimal), and
2809 KEYCODE is given in decimal.
2818 $ setkeycodes e030 127
2832 lash -- the BusyBox LAme SHell (command interpreter)
2836 This command does not yet have proper documentation.
2840 Use lash just as you would use any other shell. It
2841 properly handles pipes, redirects, job control, can be
2842 used as the shell for scripts (#!/bin/sh), and has a
2843 sufficient set of builtins to do what is needed. It does
2844 not (yet) support Bourne Shell syntax. If you need
2845 things like ``if-then-else'', ``while'', and such, use
2846 ash or bash. If you just need a very simple and
2847 extremely small shell, this will do the job.
2852 <title>sleep</title>
2859 Pause for N seconds.
2869 [2 second delay results]
2878 Usage: sort [OPTION]... [FILE]...
2882 Sort lines of text in FILE(s).
2891 -n Compare numerically
2892 -r Reverse after sorting
2902 $ echo -e "e\nf\nb\nd\nc\na" | sort
2913 <sect1 id="swapoff">
2914 <title>swapoff</title>
2917 Usage: swapoff [OPTION] [DEVICE]
2921 Stop swapping virtual memory pages on DEVICE.
2930 -a Stop swapping on all swap devices
2936 <title>swapon</title>
2939 Usage: swapon [OPTION] [DEVICE]
2943 Start swapping virtual memory pages on the given device.
2952 -a Start swapping on all swap devices
2965 Write all buffered filesystem blocks to disk.
2969 <sect1 id="syslogd">
2970 <title>syslogd</title>
2973 Usage: syslogd [OPTION]...
2977 Linux system and kernel (provides klogd) logging
2978 utility. Note that this version of syslogd/klogd ignores
2988 -m NUM Interval between MARK lines (default=20min, 0=off)
2989 -n Run as a foreground process
2990 -K Do not start up the klogd process
2991 -O FILE Use an alternate log file (default=/var/log/messages)
2992 -R HOST[:PORT] Log messages to HOST on PORT (default=514) over UDP.
3002 $ syslogd -R masterlog:514
3003 $ syslogd -R 192.168.1.1:601
3012 Usage: tail [OPTION] [FILE]...
3016 Print last 10 lines of each FILE to standard output.
3017 With more than one FILE, precede each with a header
3018 giving the file name. With no FILE, or when FILE is -,
3028 -n NUM Print last NUM lines instead of last 10
3029 -f Output data as the file grows. This version
3030 of 'tail -f' supports only one file at a time.
3040 $ tail -n 1 /etc/resolv.conf
3050 Usage: tar [MODE] [OPTION] [FILE]...
3058 MODE may be chosen from
3075 f FILE Use FILE for tarfile (or stdin if '-')
3077 exclude FILE File to exclude
3078 v List files processed
3088 $ zcat /tmp/tarball.tar.gz | tar -xf -
3089 $ tar -cf /tmp/tarball.tar /usr/local
3098 Usage: tee [OPTION]... [FILE]...
3102 Copy stdin to FILE(s), and also to stdout.
3111 -a Append to the given FILEs, do not overwrite
3121 $ echo "Hello" | tee /tmp/foo
3130 <title>telnet</title>
3133 Usage: telnet HOST [PORT]
3137 Establish interactive communication with another
3138 computer over a network using the TELNET protocol.
3143 <title>test, [</title>
3146 Usage: test EXPRESSION
3154 Check file types and compare values returning an exit
3155 code determined by the value of EXPRESSION.
3181 <title>touch</title>
3184 Usage: touch [OPTION]... FILE...
3188 Update the last-modified date on (or create) FILE(s).
3197 -c Do not create files
3208 /bin/ls: /tmp/foo: No such file or directory
3211 -rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo
3220 Usage: tr [OPTION]... STRING1 [STRING2]
3224 Translate, squeeze, and/or delete characters from stdin,
3234 -c Take complement of STRING1
3235 -d Delete input characters coded STRING1
3236 -s Squeeze multiple output characters of STRING2 into one character
3246 $ echo "gdkkn vnqkc" | tr [a-y] [b-z]
3260 Return an exit code of TRUE (1).
3284 Print the file name of the terminal connected to stdin.
3293 -s Print nothing, only return an exit status
3310 <title>umount</title>
3313 Usage: umount [OPTION]... DEVICE|DIRECTORY
3326 -a Unmount all file systems
3327 -r Try to remount devices as read-only if mount is busy
3328 -f Force filesystem umount (i.e. unreachable NFS server)
3329 -l Do not free loop device (if a loop device has been used)
3345 <title>uname</title>
3348 Usage: uname [OPTION]...
3352 Print certain system information. With no OPTION, same
3362 -a Print all information
3363 -m Print the machine (hardware) type
3364 -n Print the machine's network node hostname
3365 -r Print the operating system release
3366 -s Print the operating system name
3367 -p Print the host processor type
3368 -v Print the operating system version
3379 Linux debian 2.2.15pre13 #5 Tue Mar 14 16:03:50 MST 2000 i686 unknown
3388 Usage: uniq [INPUT [OUTPUT]]
3392 Discard all but one of successive identical lines from
3393 INPUT (or stdin), writing to OUTPUT (or stdout).
3402 $ echo -e "a\na\nb\nc\nc\na" | sort | uniq
3410 <sect1 id="unix2dos">
3411 <title>unix2dos</title>
3414 Usage: unix2dos < unixfile > dosfile
3418 Converts a text file from unix format to dos format.
3424 <titleunrpmuniq</title>
3427 Usage: unrpm < package.rpm | gzip -d | cpio -idmuv
3431 Extracts an rpm archive.
3437 <title>update</title>
3440 Usage: update [OPTION]...
3444 Periodically flush filesystem buffers.
3453 -S Force use of sync(2) instead of flushing
3454 -s SECS Call sync this often (default 30)
3455 -f SECS Flush some buffers this often (default 5)
3461 <title>uptime</title>
3468 Display how long the system has been running since boot.
3478 1:55pm up 2:30, load average: 0.09, 0.04, 0.00
3484 <title>usleep</title>
3491 Pause for N microseconds.
3501 [pauses for 1 second]
3506 <sect1 id="uudecode">
3507 <title>uudecode</title>
3510 Usage: uudecode [OPTION] [FILE]
3514 Uudecode a uuencoded file.
3523 -o FILE Direct output to FILE
3533 $ uudecode -o busybox busybox.uu
3535 -rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox
3540 <sect1 id="uuencode">
3541 <title>uuencode</title>
3544 Usage: uuencode [OPTION] [INFILE] OUTFILE
3557 -m Use base64 encoding as of RFC1521
3567 $ uuencode busybox busybox
3569 M?T5,1@$!`0````````````(``P`!````L+@$"#0```!0N@,``````#0`(``&
3571 $ uudecode busybox busybox > busybox.uu
3581 Usage: wc [OPTION]... [FILE]...
3585 Print line, word, and byte counts for each FILE, and a
3586 total line if more than one FILE is specified. With no
3596 -c Print the byte counts
3597 -l Print the newline counts
3598 -L Print the length of the longest line
3599 -w Print the word counts
3610 31 46 1365 /etc/passwd
3616 <title>which</title>
3619 Usage: which [COMMAND]...
3639 <title>whoami</title>
3646 Print the user name associated with the current
3666 Usage: yes [STRING]...
3670 Repeatedly output a line with all specified STRING(s),
3679 Usage: zcat [OPTION]... FILE
3683 Uncompress FILE (or stdin if FILE is '-') to stdout.
3692 -t Test compressed file integrity
3707 <chapter id="LIBC-NSS">
3708 <title>LIBC NSS</title>
3711 GNU Libc uses the Name Service Switch (NSS) to configure the
3712 behavior of the C library for the local environment, and to
3713 configure how it reads system data, such as passwords and group
3714 information. BusyBox has made it Policy that it will never use
3715 NSS, and will never use libc calls that make use of NSS. This
3716 allows you to run an embedded system without the need for
3717 installing an /etc/nsswitch.conf file and without /lib/libnss_*
3718 libraries installed.
3722 If you are using a system that is using a remote LDAP server for
3723 authentication via GNU libc NSS, and you want to use BusyBox,
3724 then you will need to adjust the BusyBox source. Chances are
3725 though, that if you have enough space to install of that stuff
3726 on your system, then you probably want the full GNU utilities.
3730 <chapter id="SEE-ALSO">
3731 <title>SEE ALSO</title>
3734 <literal>textutils(1),</literal>
3735 <literal>shellutils(1),</literal>
3740 <chapter id="MAINTAINER">
3741 <title>MAINTAINER</title>
3744 Erik Andersen <andersee@debian.org> <andersen@lineo.com>
3748 <chapter id="AUTHORS">
3749 <title>AUTHORS</title>
3752 The following people have contributed code to BusyBox whether
3753 they know it or not.
3757 Erik Andersen <andersee@debian.org>
3761 John Beppu <beppu@lineo.com>
3765 Brian Candler <B.Candler@pobox.com>
3769 Randolph Chung <tausq@debian.org>
3773 Dave Cinege <dcinege@psychosis.com>
3777 Karl M. Hegbloom <karlheg@debian.org>
3781 John Lombardo <john@deltanet.com>
3785 Glenn McGrath <bug1@netconnect.com.au>
3789 Bruce Perens <bruce@perens.com>
3793 Pavel Roskin <proski@gnu.org>
3797 Linus Torvalds <torvalds@transmeta.com>
3801 Mark Whitley <markw@lineo.com>
3805 Charles P. Wright <cpwright@villagenet.com>
3809 Enrique Zanardi <ezanardi@ull.es>
3812 </book> <!-- End of the book -->