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, cp, cut, date,
136 dc, dd, deallocvt, df, dirname, dmesg, du, dutmp, echo, false, fbset,
137 fdflush, find, free, freeramdisk, fsck.minix, grep, gunzip, gzip, halt,
138 head, hostid, hostname, id, init, insmod, kill, killall, length, ln,
139 loadacm, loadfont, loadkmap, logger, logname, ls, lsmod, makedevs, mkdir,
140 mkfifo, mkfs.minix, mknod, mkswap, mktemp, more, mount, mt, mv, nc,
141 nslookup, ping, poweroff, printf, ps, pwd, reboot, rm, rmdir, rmmod, sed,
142 setkeycodes, sfdisk, sh, sleep, sort, swapoff, swapon, sync, syslogd, tail,
143 tar, tee, telnet, test, touch, tr, true, tty, umount, uname, uniq, update,
144 uptime, usleep, uudecode, uuencode, wc, which, whoami, yes, zcat, [
152 Usage: ar [OPTION] archive [FILENAME]...
156 Extract or list files from an ar archive.
165 o Preserve original dates
169 v Verbosely list files processed
174 <sect1 id="basename">
175 <title>basename</title>
177 Usage: basename FILE [SUFFIX]
181 Strip directory path and suffixes from FILE. If specified, also removes
191 $ basename /usr/local/bin/foo
193 $ basename /usr/local/bin/
195 $ basename /foo/bar.txt .txt
209 Concatenate <literal>FILE(s)</literal> and prints them to the standard
229 Usage: chgrp [OPTION]... GROUP FILE...
233 Change the group membership of each FILE to GROUP.
242 -R Change files and directories recursively
253 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
254 $ chgrp root /tmp/foo
256 -r--r--r-- 1 andersen root 0 Apr 12 18:25 /tmp/foo
265 Usage: chmod [<emphasis>-R</emphasis>] MODE[,MODE]... FILE...
269 Change file access permissions for the specified
270 <literal>FILE(s)</literal> (or directories). Each MODE is defined by
271 combining the letters for WHO has access to the file, an OPERATOR for
272 selecting how the permissions should be changed, and a PERMISSION for
273 <literal>FILE(s)</literal> (or directories).
277 WHO may be chosen from
282 u User who owns the file
283 g Users in the file's Group
284 o Other users not in the file's group
290 OPERATOR may be chosen from
296 - Remove a permission
297 = Assign a permission
302 PERMISSION may be chosen from
309 x Execute (or access for directories)
310 s Set user (or group) ID bit
311 t Sticky bit (for directories prevents removing files by non-owners)
316 Alternately, permissions can be set numerically where the first three
317 numbers are calculated by adding the octal values, such as
329 An optional fourth digit can also be used to specify
346 -R Change files and directories recursively.
357 -rw-rw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo
360 -rwxrw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo*
363 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
371 Usage: chown [OPTION]... OWNER[<.|:>[GROUP] FILE...
375 Change the owner and/or group of each FILE to OWNER and/or GROUP.
384 -R Change files and directories recursively
395 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
396 $ chown root /tmp/foo
398 -r--r--r-- 1 root andersen 0 Apr 12 18:25 /tmp/foo
399 $ chown root.root /tmp/foo
401 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
407 <title>chroot</title>
409 Usage: chroot NEWROOT [COMMAND...]
413 Run COMMAND with root directory set to NEWROOT.
423 lrwxrwxrwx 1 root root 12 Apr 13 00:46 /bin/ls -> /BusyBox
424 $ mount /dev/hdc1 /mnt -t minix
427 -rwxr-xr-x 1 root root 40816 Feb 5 07:45 /bin/ls*
439 Change the foreground virtual terminal to /dev/ttyN
459 Usage: cp [OPTION]... SOURCE DEST
464 or: cp [OPTION]... SOURCE... DIRECTORY
469 Copy SOURCE to DEST, or multiple <literal>SOURCE(s)</literal> to
481 -p Preserve file attributes if possible
482 -R Copy directories recursively
491 Usage: cut [OPTION]... [FILE]...
495 Print selected fields from each input FILE to standard output.
504 -b LIST Output only bytes from LIST
505 -c LIST Output only characters from LIST
506 -d CHAR Use CHAR instead of tab as the field delimiter
507 -s Only output Lines if the include DELIM
508 -f N Print only these fields
519 $ echo "Hello world" | cut -f 1 -d ' '
521 $ echo "Hello world" | cut -f 2 -d ' '
531 Usage: date [OPTION]... [+FORMAT]
536 or: date [OPTION] [MMDDhhmm[[CC]YY][.ss]]
541 Display the current time in the given FORMAT, or set the system date.
550 -R Output RFC-822 compliant date string
551 -s Set time described by STRING
552 -u Print or set Coordinated Universal Time
563 Wed Apr 12 18:52:41 MDT 2000
572 Usage: dc [EXPRESSION]
576 This is a Tiny RPN calculator that understands the
577 following operations: +, -, /, *, and, or, not, eor. If
578 no arguments are given, dc will process input from
583 The behaviour of BusyBox/dc deviates (just a little ;-)
584 from GNU/dc, but this will be remedied in the future.
601 $ echo 72 9 div 8 mul | dc
611 Usage: dd [OPTION]...
615 Copy a file, converting and formatting according to
625 if=FILE Read from FILE instead of stdin
626 of=FILE Write to FILE instead of stdout
627 bs=N Read and write N bytes at a time
628 count=N Copy only N input blocks
629 skip=N Skip N input blocks
630 seek=N Skip N output blocks
635 Numbers may be suffixed by w (x2), k (x1024), b (x512),
645 $ dd if=/dev/zero of=/dev/ram1 bs=1M count=4
652 <sect1 id="deallocvt">
653 <title>deallocvt</title>
660 Deallocate unused virtual terminal /dev/ttyN.
672 Print the filesystem space used and space available.
682 Filesystem 1k-blocks Used Available Use% Mounted on
683 /dev/sda3 8690864 8553540 137324 98% /
684 /dev/sda1 64216 36364 27852 57% /boot
686 Filesystem 1k-blocks Used Available Use% Mounted on
687 /dev/sda3 8690864 8553540 137324 98% /
693 <title>dirname</title>
700 Strip non-directory suffix from NAME.
721 Usage: dmesg [OPTION]...
725 Print or control the kernel ring buffer.
734 -c Clear the ring buffer after printing
735 -n LEVEL Set the console logging level to LEVEL
736 -s BUFSIZE Query ring buffer using a buffer of BUFSIZE
745 Usage: du [OPTION]... [FILE]...
749 Summarize the disk space used for each FILE or current
750 directory. Disk space printed in units of 1k (i.e.
760 -l Count sizes many times if hard linked
761 -s Display only a total for each argument
773 12 ./kernel-patches/CVS
794 Dump utmp file format (pipe delimited) from FILE or
804 $ dutmp /var/run/utmp
805 8|7||si|||0|0|0|955637625|760097|0
806 2|0|~|~~|reboot||0|0|0|955637625|782235|0
807 1|20020|~|~~|runlevel||0|0|0|955637625|800089|0
808 8|125||l4|||0|0|0|955637629|998367|0
809 6|245|tty1|1|LOGIN||0|0|0|955637630|998974|0
810 6|246|tty2|2|LOGIN||0|0|0|955637630|999498|0
811 7|336|pts/0|vt00andersen|andersen|:0.0|0|0|0|955637763|0|0
820 Usage: echo [OPTION]... [ARG]...
824 Print ARGs to stdout.
833 -n Suppress trailing newline
834 -e Enable interpretation of escaped characters
835 -E Disable interpretation of escaped characters
845 $ echo "Erik is cool"
847 $ echo -e "Erik\nis\ncool"
851 $ echo "Erik\nis\ncool"
865 Returns an exit code of FALSE (1).
885 Usage: fbset [OPTION]... [MODE]
889 Show and modify frame buffer device settings.
898 -h Display option summary
899 -fb DEVICE Operate on DEVICE
900 -db FILE Use FILE for mode database
901 -g XRES YRES VXRES VYRES DEPTH Set all geometry parameters
902 -t PIXCLOCK LEFT RIGHT UPPER LOWER HSLEN VSLEN Set all timing parameters
903 -xres RES Set visible horizontal resolution
904 -yres RES Set visible vertical resolution
916 # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz
917 geometry 1024 768 1024 768 16
918 timings 12714 128 32 16 4 128 4
920 rgba 5/11,6/5,5/0,0/0
927 <title>fdflush</title>
930 Usage: fdflush DEVICE
934 Force floppy disk drive to detect disk change on DEVICE.
942 Usage: find [PATH]... [EXPRESSION]
946 Search for files in a directory hierarchy. The default
947 PATH is the current directory; default EXPRESSION is
952 EXPRESSION may consist of:
957 -follow Dereference symbolic links
958 -name PATTERN File name (leading directories removed) matches PATTERN
959 -print Print the full file name followed by a newline to stdout
969 $ find / -name /etc/passwd
983 Displays the amount of free and used system memory.
993 total used free shared buffers
994 Mem: 257628 248724 8904 59644 93124
995 Swap: 128516 8404 120112
996 Total: 386144 257128 129016
1001 <sect1 id="freeramdisk">
1002 <title>freeramdisk</title>
1005 Usage: freeramdisk DEVICE
1009 Free all memory used by the ramdisk DEVICE.
1018 $ freeramdisk /dev/ram2
1023 <sect1 id="fsck.minix">
1024 <title>fsck.minix</title>
1027 Usage: fsck.minix [OPTION]... DEVICE
1031 Perform a consistency check on the MINIX filesystem on
1041 -l List all filenames
1042 -r Perform interactive repairs
1043 -a Perform automatic repairs
1045 -s Output super-block information
1046 -m Activate MINIX-like "mode not cleared" warnings
1047 -f Force file system check.
1056 Usage: grep [OPTIONS]... PATTERN [FILE]...
1060 Search for PATTERN in each FILE or stdin.
1069 -h Suppress the prefixing filename on output
1070 -i Ignore case distinctions
1071 -n Print line number with output lines
1072 -q Be quiet. Returns 0 if result was found, 1 otherwise
1073 -v Select non-matching lines
1078 This version of grep matches full regular expressions.
1087 $ grep root /etc/passwd
1088 root:x:0:0:root:/root:/bin/bash
1089 $ grep ^[rR]oo. /etc/passwd
1090 root:x:0:0:root:/root:/bin/bash
1096 <title>gunzip</title>
1099 Usage: gunzip [OPTION]... FILE
1103 Uncompress FILE (or stdin if FILE is '-').
1112 -c Write output to standard output
1113 -t Test compressed file integrity
1123 $ ls -la /tmp/BusyBox*
1124 -rw-rw-r-- 1 andersen andersen 557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz
1125 $ gunzip /tmp/BusyBox-0.43.tar.gz
1126 $ ls -la /tmp/BusyBox*
1127 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1136 Usage: gzip [OPTION]... FILE
1140 Compress FILE (or stdin if FILE is '-') with maximum
1141 compression to FILE.gz (or stdout if FILE is '-').
1150 -c Write output to standard output
1160 $ ls -la /tmp/BusyBox*
1161 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1162 $ gzip /tmp/BusyBox-0.43.tar
1163 $ ls -la /tmp/BusyBox*
1164 -rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/BusyBox-0.43.tar.gz
1185 Usage: head [OPTION] FILE...
1189 Print first 10 lines of each FILE to standard output.
1190 With more than one FILE, precede each with a header
1191 giving the file name. With no FILE, or when FILE is -,
1192 read standard input.
1201 -n NUM Print first NUM lines instead of first 10
1211 $ head -n 2 /etc/passwd
1212 root:x:0:0:root:/root:/bin/bash
1213 daemon:x:1:1:daemon:/usr/sbin:/bin/sh
1219 <title>hostid</title>
1226 Prints out a unique 32-bit identifier for the current
1227 machine. The 32-bit identifier is intended to be unique
1228 among all UNIX systems in existence.
1232 <sect1 id="hostname">
1233 <title>hostname</title>
1236 Usage: hostname [OPTION]... [HOSTNAME|-F FILE]
1240 Get or set the hostname or DNS domain name. If a
1241 hostname is given (or a file with the -F parameter), the
1242 host name will be set.
1252 -i Addresses for the hostname
1254 -F FILE Use the contents of FILE to specify the hostname
1274 Usage: id [OPTION]... [USERNAME]
1278 Print information for USERNAME or the current user.
1287 -g Print only the group ID
1288 -u Print only the user ID
1289 -r Print the real user ID instead of the effective ID (with -ug)
1300 uid=1000(andersen) gid=1000(andersen)
1313 Init is the parent of all processes.
1317 This version of init is designed to be run only by the
1322 BusyBox init doesn't support multiple runlevels. The
1323 runlevels field of the /etc/inittab file is completely
1324 ignored by BusyBox init. If you want runlevels, use
1329 BusyBox init works just fine without an inittab. If no
1330 inittab is found, it has the following default behavior:
1335 ::sysinit:/etc/init.d/rcS
1341 If it detects that /dev/console is _not_ a serial
1342 console, it will also run:
1347 tty2::askfirst:/bin/sh
1352 If you choose to use an /etc/inittab file, the inittab
1353 entry format is as follows:
1358 <id>:<runlevels>:<action>:<process>
1365 WARNING: This field has a non-traditional
1366 meaning for BusyBox init! The id field is used
1367 by BusyBox init to specify the controlling tty
1368 for the specified process to run on. The
1369 contents of this field are appended to "/dev/"
1370 and used as-is. There is no need for this field
1371 to be unique, although if it isn't you may have
1372 strange results. If this field is left blank,
1373 it is completely ignored. Also note that if
1374 BusyBox detects that a serial console is in use,
1375 then all entries containing non-empty id fields
1376 will _not_ be run. BusyBox init does nothing
1377 with utmp. We don't need no stinkin' utmp.
1382 <title>runlevels</title>
1385 The runlevels field is completely ignored.
1390 <title>action</title>
1393 Valid actions include: sysinit, respawn,
1394 askfirst, wait, once, and ctrlaltdel.
1398 askfirst acts just like respawn, but before
1399 running the specified process it displays the
1400 line "Please press Enter to activate this
1401 console." and then waits for the user to press
1402 enter before starting the specified process.
1406 Unrecognized actions (like initdefault) will
1407 cause init to emit an error message, and then go
1408 along with its business.
1413 <title>process</title>
1416 Specifies the process to be executed and its
1422 Example /etc/inittab file:
1427 # This is run first except when booting in single-user mode.
1429 ::sysinit:/etc/init.d/rcS
1431 # /bin/sh invocations on selected ttys
1433 # Start an "askfirst" shell on the console (whatever that may be)
1435 # Start an "askfirst" shell on /dev/tty2
1436 tty2::askfirst:/bin/sh
1438 # /sbin/getty invocations for selected ttys
1440 tty4::respawn:/sbin/getty 38400 tty4
1441 tty5::respawn:/sbin/getty 38400 tty5
1443 # Example of how to put a getty on a serial line (for a terminal)
1445 #ttyS0::respawn:/sbin/getty -L ttyS0 9600 vt100
1446 #ttyS1::respawn:/sbin/getty -L ttyS1 9600 vt100
1448 # Example how to put a getty on a modem line.
1449 #ttyS2::respawn:/sbin/getty -x0 -s 57600 ttyS2
1451 # Stuff to do before rebooting
1452 ::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1
1453 ::ctrlaltdel:/sbin/swapoff -a > /dev/null 2>&1
1459 <title>insmod</title>
1462 Usage: insmod [OPTION]... MODULE [symbol=value]...
1466 Loads MODULE into the kernel.
1475 -f Force module to load into the wrong kernel version.
1476 -k Make module autoclean-able.
1478 -x Do not export externs
1487 Usage: kill [OPTION] PID...
1491 Send a signal (default is SIGTERM) to the specified
1501 -l List all signal names and numbers
1502 -SIG Send signal SIG
1513 252 root root S [apache]
1514 263 www-data www-data S [apache]
1515 264 www-data www-data S [apache]
1516 265 www-data www-data S [apache]
1517 266 www-data www-data S [apache]
1518 267 www-data www-data S [apache]
1524 <sect1 id="killall">
1525 <title>killall</title>
1528 Usage: killall [OPTION] NAME...
1532 Send a signal (default is SIGTERM) to the specified
1542 -l List all signal names and numbers
1543 -SIG Send signal SIG
1559 <title>length</title>
1562 Usage: length STRING
1566 Print the length of STRING.
1585 Usage: ln [OPTION]... TARGET FILE|DIRECTORY
1589 Create a link named FILE or DIRECTORY to the specified
1590 TARGET. You may use '--' to indicate that all following
1591 arguments are non-options.
1600 -s Make symbolic link instead of hard link
1601 -f Remove existing destination file
1611 $ ln -s BusyBox /tmp/ls
1613 lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -> BusyBox*
1618 <sect1 id="loadacm">
1619 <title>loadacm</title>
1626 Load an acm from stdin.
1635 $ loadacm < /etc/i18n/acmname
1640 <sect1 id="loadfont">
1641 <title>loadfont</title>
1648 Load a console font from stdin.
1657 $ loadfont < /etc/i18n/fontname
1662 <sect1 id="loadkmap">
1663 <title>loadkmap</title>
1670 Load a binary keyboard translation table from stdin.
1679 $ loadkmap < /etc/i18n/lang-keymap
1685 <title>logger</title>
1688 Usage: logger [OPTION]... [MESSAGE]
1692 Write MESSAGE to the system log. If MESSAGE is '-', log
1702 -s Log to stderr as well as the system log
1703 -t Log using the specified tag (defaults to user name)
1704 -p Enter the message with the specified priority
1705 This may be numerical or a ``facility.level'' pair
1720 <sect1 id="logname">
1721 <title>logname</title>
1728 Print the name of the current user.
1747 Usage: ls [OPTION]... [FILE]...
1760 -a Do not hide entries starting with .
1761 -c With -l: show ctime (the time of last
1762 modification of file status information)
1763 -d List directory entries instead of contents
1764 -e List both full date and full time
1765 -l Use a long listing format
1766 -n List numeric UIDs and GIDs instead of names
1767 -p Append indicator (one of /=@|) to entries
1768 -u With -l: show access time (the time of last
1770 -x List entries by lines instead of by columns
1771 -A Do not list implied . and ..
1772 -C List entries by columns
1773 -F Append indicator (one of */=@|) to entries
1774 -R List subdirectories recursively
1789 <title>lsmod</title>
1796 List currently loaded kernel modules.
1800 <sect1 id="makedevs">
1801 <title>makedevs</title>
1804 Usage: makedevsf NAME TYPE MAJOR MINOR FIRST LAST [s]
1808 Create a range of block or character special files.
1817 b Make a block (buffered) device
1818 c or u Make a character (un-buffered) device
1819 p Make a named pipe. MAJOR and MINOR are ignored for named pipes
1824 FIRST specifies the number appended to NAME to create
1825 the first device. LAST specifies the number of the last
1826 item that should be created. If 's' is the last
1827 argument, the base device is created as well.
1836 $ makedevs /dev/ttyS c 4 66 2 63
1837 [creates ttyS2-ttyS63]
1838 $ makedevs /dev/hda b 3 0 0 8 s
1839 [creates hda,hda1-hda8]
1844 <!-- This is where I have stopped formatting stuff -->
1845 <varlistentry><term><emphasis>md5sum
1848 <listitem><para></para>
1851 Usage: md5sum [OPTION] [file ...]
1857 Print or check MD5 checksums.
1870 -b read files in binary mode
1871 -c check MD5 sums against given list
1872 -t read files in text mode (default)
1880 The following two options are useful only when verifying checksums:
1887 -s don't output anything, status code shows success
1888 -w warn about improperly formated MD5 checksum lines
1903 6fd11e98b98a58f64ff3398d7b324003 busybox
1905 6fd11e98b98a58f64ff3398d7b324003 busybox
1914 -------------------------------
1919 </listitem></varlistentry>
1920 <varlistentry><term><emphasis>mkdir
1923 <listitem><para></para>
1926 Usage: mkdir [OPTION] DIRECTORY...
1932 Create the <literal>DIRECTORY(ies),</literal> if they do not already exist
1945 -m set permission mode (as in chmod), not rwxrwxrwx - umask
1946 -p no error if directory exists, make parent directories as needed
1962 /tmp/foo: File exists
1963 $ mkdir /tmp/foo/bar/baz
1964 /tmp/foo/bar/baz: No such file or directory
1965 $ mkdir -p /tmp/foo/bar/baz
1972 -------------------------------
1977 </listitem></varlistentry>
1978 <varlistentry><term><emphasis>mkfifo
1981 <listitem><para></para>
1984 Usage: mkfifo [OPTIONS] name
1990 Creates a named pipe (identical to 'mknod name p')
2003 -m create the pipe using the specified mode (default a=rw)
2010 -------------------------------
2015 </listitem></varlistentry>
2016 <varlistentry><term><emphasis>mkfs.minix
2019 <listitem><para></para>
2022 Usage: mkfs.minix [<emphasis>-c</emphasis> | <emphasis>-l</emphasis> filename] [<emphasis>-nXX</emphasis>] [<emphasis>-iXX</emphasis>] /dev/name [blocks]
2028 Make a MINIX filesystem.
2041 -c Check the device for bad blocks
2042 -n [14|30] Specify the maximum length of filenames
2043 -i Specify the number of inodes for the filesystem
2044 -l FILENAME Read the bad blocks list from FILENAME
2045 -v Make a Minix version 2 filesystem
2052 -------------------------------
2057 </listitem></varlistentry>
2058 <varlistentry><term><emphasis>mknod
2061 <listitem><para></para>
2064 Usage: mknod [OPTIONS] NAME TYPE MAJOR MINOR
2070 Create a special file (block, character, or pipe).
2083 -m create the special file using the specified mode (default a=rw)
2090 TYPEs include: b: Make a block (buffered) device. c or u: Make a character
2091 (un-buffered) device. p: Make a named pipe. MAJOR and MINOR are ignored for
2105 $ mknod /dev/fd0 b 2 0
2106 $ mknod -m 644 /tmp/pipe p
2113 -------------------------------
2118 </listitem></varlistentry>
2119 <varlistentry><term><emphasis>mkswap
2122 <listitem><para></para>
2125 Usage: mkswap [<emphasis>-c</emphasis>] [<emphasis>-v0</emphasis>|<emphasis>-v1</emphasis>] device [block-count]
2131 Prepare a disk partition to be used as a swap partition.
2144 -c Check for read-ability.
2145 -v0 Make version 0 swap [max 128 Megs].
2146 -v1 Make version 1 swap [big!] (default for kernels > 2.1.117).
2147 block-count Number of block to use (default is entire partition).
2154 -------------------------------
2159 </listitem></varlistentry>
2160 <varlistentry><term><emphasis>mktemp
2163 <listitem><para></para>
2166 Usage: mktemp [<emphasis>-q</emphasis>] TEMPLATE
2172 Creates a temporary file with its name based on TEMPLATE. TEMPLATE is any
2173 name with six `Xs' (i.e. /tmp/temp.XXXXXX).
2186 $ mktemp /tmp/temp.XXXXXX
2188 $ ls -la /tmp/temp.mWiLjM
2189 -rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM
2196 -------------------------------
2201 </listitem></varlistentry>
2202 <varlistentry><term><emphasis>more
2205 <listitem><para></para>
2208 Usage: more [file ...]
2214 More is a filter for paging through text one screenful at a time.
2234 -------------------------------
2239 </listitem></varlistentry>
2240 <varlistentry><term><emphasis>mount
2243 <listitem><para></para>
2246 Usage: mount [flags] mount [flags] device directory [<emphasis>-o</emphasis> options,more-options]
2259 -a: Mount all file systems in fstab.
2260 -o option: One of many filesystem options, listed below.
2261 -r: Mount the filesystem read-only.
2262 -t fs-type: Specify the filesystem type.
2263 -w: Mount for reading and writing (default).
2270 Options for use with the ``<emphasis>-o</emphasis>'' flag:
2277 async/sync: Writes are asynchronous / synchronous.
2278 atime/noatime: Enable / disable updates to inode access times.
2279 dev/nodev: Allow use of special device files / disallow them.
2280 exec/noexec: Allow use of executable files / disallow them.
2281 loop: Mounts a file via loop device.
2282 suid/nosuid: Allow set-user-id-root programs / disallow them.
2283 remount: Re-mount a currently-mounted filesystem, changing its flags.
2284 ro/rw: Mount for read-only / read-write.
2285 There are EVEN MORE flags that are specific to each filesystem.
2286 You'll have to see the written documentation for those.
2301 /dev/hda3 on / type minix (rw)
2302 proc on /proc type proc (rw)
2303 devpts on /dev/pts type devpts (rw)
2304 $ mount /dev/fd0 /mnt -t msdos -o ro
2305 $ mount /tmp/diskimage /opt -t ext2 -o loop
2312 -------------------------------
2317 </listitem></varlistentry>
2318 <varlistentry><term><emphasis>mt
2321 <listitem><para></para>
2324 Usage: mt [<emphasis>-f</emphasis> device] opcode value
2330 Control magnetic tape drive operation
2336 -------------------------------
2341 </listitem></varlistentry>
2342 <varlistentry><term><emphasis>mv
2345 <listitem><para></para>
2348 Usage: mv SOURCE DEST
2355 or: mv SOURCE... DIRECTORY
2362 Rename SOURCE to DEST, or move <literal>SOURCE(s)</literal> to DIRECTORY.
2375 $ mv /tmp/foo /bin/bar
2382 -------------------------------
2387 </listitem></varlistentry>
2388 <varlistentry><term><emphasis>nc
2391 <listitem><para></para>
2394 Usage: nc [IP] [port]
2400 Netcat opens a pipe to IP:port
2413 $ nc foobar.somedomain.com 25
2414 220 foobar ESMTP Exim 3.12 #1 Sat, 15 Apr 2000 00:03:02 -0600
2416 214-Commands supported:
2417 214- HELO EHLO MAIL RCPT DATA AUTH
2418 214 NOOP QUIT RSET HELP
2420 221 foobar closing connection
2427 -------------------------------
2432 </listitem></varlistentry>
2433 <varlistentry><term><emphasis>nslookup
2436 <listitem><para></para>
2439 Usage: nslookup [HOST]
2445 Queries the nameserver for the IP address of the given HOST
2458 $ nslookup localhost
2476 -------------------------------
2481 </listitem></varlistentry>
2482 <varlistentry><term><emphasis>ping
2485 <listitem><para></para>
2488 Usage: ping [OPTION]... host
2494 Send ICMP ECHO_REQUEST packets to network hosts.
2507 -c COUNT Send only COUNT pings.
2508 -s SIZE Send SIZE data bytes in packets (default=56).
2509 -q Quiet mode, only displays output at start
2520 PING slag (127.0.0.1): 56 data bytes
2521 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=20.1 ms
2529 --- debian ping statistics ---
2530 1 packets transmitted, 1 packets received, 0% packet loss
2531 round-trip min/avg/max = 20.1/20.1/20.1 ms
2538 -------------------------------
2543 </listitem></varlistentry>
2544 <varlistentry><term><emphasis>poweroff
2547 <listitem><para></para>
2550 Shuts down the system, and requests that the kernel turn off power upon
2557 -------------------------------
2562 </listitem></varlistentry>
2563 <varlistentry><term><emphasis>printf
2566 <listitem><para></para>
2569 Usage: printf format [argument...]
2575 Formats and prints the given data in a manner similar to the C printf
2589 $ printf "Val=%d\n" 5
2597 -------------------------------
2602 </listitem></varlistentry>
2603 <varlistentry><term><emphasis>ps
2606 <listitem><para></para>
2615 Report process status
2621 This version of ps accepts no options.
2635 PID Uid Gid State Command
2637 2 root root S [kflushd]
2638 3 root root S [kupdate]
2639 4 root root S [kpiod]
2640 5 root root S [kswapd]
2641 742 andersen andersen S [bash]
2642 743 andersen andersen S -bash
2643 745 root root S [getty]
2644 2990 andersen andersen R ps
2651 -------------------------------
2656 </listitem></varlistentry>
2657 <varlistentry><term><emphasis>pwd
2660 <listitem><para></para>
2663 Prints the full filename of the current working directory.
2684 -------------------------------
2689 </listitem></varlistentry>
2690 <varlistentry><term><emphasis>reboot
2693 <listitem><para></para>
2696 Instructs the kernel to reboot the system.
2702 -------------------------------
2707 </listitem></varlistentry>
2708 <varlistentry><term><emphasis>rm
2711 <listitem><para></para>
2714 Usage: rm [OPTION]... FILE...
2720 Remove (unlink) the <literal>FILE(s).</literal> You may use '--' to
2721 indicate that all following arguments are non-options.
2734 -f remove existing destinations, never prompt
2735 -r or -R remove the contents of directories recursively
2756 -------------------------------
2761 </listitem></varlistentry>
2762 <varlistentry><term><emphasis>rmdir
2765 <listitem><para></para>
2768 Usage: rmdir [OPTION]... DIRECTORY...
2774 Remove the <literal>DIRECTORY(ies),</literal> if they are empty.
2794 -------------------------------
2799 </listitem></varlistentry>
2800 <varlistentry><term><emphasis>rmmod
2803 <listitem><para></para>
2806 Usage: rmmod [OPTION]... [MODULE]...
2812 Unloads the specified kernel modules from the kernel.
2825 -a Try to remove all unused kernel modules.
2846 -------------------------------
2851 </listitem></varlistentry>
2852 <varlistentry><term><emphasis>sed
2855 <listitem><para></para>
2858 Usage: sed [<emphasis>-n</emphasis>] <emphasis>-e</emphasis> script [file...]
2864 Allowed sed scripts come in the following form:
2879 where address ADDR can be:
2880 NUMBER Match specified line number
2882 /REGEXP/ Match specified regexp
2883 (! inverts the meaning of the match)
2892 s/regexp/replacement/[igp]
2893 which attempt to match regexp against the pattern space
2894 and if successful replaces the matched portion with replacement.
2903 which appends TEXT after the pattern space
2917 -e add the script to the commands to be executed
2918 -n suppress automatic printing of pattern space
2925 This version of sed matches full regular expressions.
2938 $ echo "foo" | sed -e 's/f[a-zA-Z]o/bar/g'
2946 -------------------------------
2951 </listitem></varlistentry>
2952 <varlistentry><term><emphasis>setkeycodes
2955 <listitem><para></para>
2958 Usage: setkeycodes SCANCODE KEYCODE ...
2964 Set entries into the kernel's scancode-to-keycode map, allowing unusual
2965 keyboards to generate usable keycodes.
2971 SCANCODE may be either xx or e0xx (hexadecimal), and KEYCODE is given in
2985 # setkeycodes e030 127
2992 -------------------------------
2997 </listitem></varlistentry>
2998 <varlistentry><term><emphasis>sfdisk
3001 <listitem><para></para>
3004 Usage: sfdisk [options] device ...
3010 device: something like /dev/hda or /dev/sda
3023 -s [or --show-size]: list size of a partition
3024 -c [or --id]: print or change partition Id
3025 -l [or --list]: list partitions of each device
3026 -d [or --dump]: idem, but in a format suitable for later input
3027 -i [or --increment]: number cylinders etc. from 1 instead of from 0
3028 -uS, -uB, -uC, -uM: accept/report in units of sectors/blocks/cylinders/MB
3029 -T [or --list-types]:list the known partition types
3030 -D [or --DOS]: for DOS-compatibility: waste a little space
3031 -R [or --re-read]: make kernel reread partition table
3032 -N# : change only the partition with number #
3033 -n : do not actually write to disk
3034 -O file : save the sectors that will be overwritten to file
3035 -I file : restore these sectors again
3036 -v [or --version]: print version
3037 -? [or --help]: print this message
3051 -g [or --show-geometry]: print the kernel's idea of the geometry
3052 -x [or --show-extended]: also list extended partitions on output
3060 or expect descriptors for them on input
3061 -L [or --Linux]: do not complain about things irrelevant for Linux
3062 -q [or --quiet]: suppress warning messages
3063 You can override the detected geometry using:
3064 -C# [or --cylinders #]:set the number of cylinders to use
3065 -H# [or --heads #]: set the number of heads to use
3066 -S# [or --sectors #]: set the number of sectors to use
3073 You can disable all consistency checking with:
3080 -f [or --force]: do what I say, even if it is stupid
3087 -------------------------------
3092 </listitem></varlistentry>
3093 <varlistentry><term><emphasis>sh
3096 <listitem><para></para>
3105 lash -- the BusyBox LAme SHell (command interpreter)
3111 This command does not yet have proper documentation.
3117 Use lash just as you would use any other shell. It properly handles pipes,
3118 redirects, job control, can be used as the shell for scripts (#!/bin/sh),
3119 and has a sufficient set of builtins to do what is needed. It does not
3120 (yet) support Bourne Shell syntax. If you need things like
3121 ``if-then-else'', ``while'', and such, use ash or bash. If you just need a
3122 very simple and extremely small shell, this will do the job.
3128 -------------------------------
3133 </listitem></varlistentry>
3134 <varlistentry><term><emphasis>sleep
3137 <listitem><para></para>
3146 Pause for N seconds.
3160 [2 second delay results]
3167 -------------------------------
3172 </listitem></varlistentry>
3173 <varlistentry><term><emphasis>sort
3176 <listitem><para></para>
3179 Usage: sort [<emphasis>-n</emphasis>] [<emphasis>-r</emphasis>] [FILE]...
3185 Sorts lines of text in the specified files
3198 $ echo -e "e\nf\nb\nd\nc\na" | sort
3211 -------------------------------
3216 </listitem></varlistentry>
3217 <varlistentry><term><emphasis>swapoff
3220 <listitem><para></para>
3223 Usage: swapoff [OPTION] [device]
3229 Stop swapping virtual memory pages on the given device.
3242 -a Stop swapping on all swap devices
3249 -------------------------------
3254 </listitem></varlistentry>
3255 <varlistentry><term><emphasis>swapon
3258 <listitem><para></para>
3261 Usage: swapon [OPTION] [device]
3267 Start swapping virtual memory pages on the given device.
3280 -a Start swapping on all swap devices
3287 -------------------------------
3292 </listitem></varlistentry>
3293 <varlistentry><term><emphasis>sync
3296 <listitem><para></para>
3305 Write all buffered filesystem blocks to disk.
3311 -------------------------------
3316 </listitem></varlistentry>
3317 <varlistentry><term><emphasis>syslogd
3320 <listitem><para></para>
3323 Usage: syslogd [OPTION]...
3329 Linux system and kernel (provides klogd) logging utility. Note that this
3330 version of syslogd/klogd ignores /etc/syslog.conf.
3343 -m NUM Interval between MARK lines (default=20min, 0=off)
3344 -n Run as a foreground process
3345 -K Do not start up the klogd process
3346 -O FILE Use an alternate log file (default=/var/log/messages)
3353 -------------------------------
3358 </listitem></varlistentry>
3359 <varlistentry><term><emphasis>tail
3362 <listitem><para></para>
3365 Usage: tail [OPTION] [FILE]...
3371 Print last 10 lines of each FILE to standard output. With more than one
3372 FILE, precede each with a header giving the file name. With no FILE, or
3373 when FILE is -, read standard input.
3386 -n NUM Print last NUM lines instead of first 10
3387 -f Output data as the file grows. This version
3388 of 'tail -f' supports only one file at a time.
3402 $ tail -n 1 /etc/resolv.conf
3410 -------------------------------
3415 </listitem></varlistentry>
3416 <varlistentry><term><emphasis>tar
3419 <listitem><para></para>
3422 Usage: tar -[cxtvO] [<emphasis>--exclude</emphasis> File] [<emphasis>-f</emphasis> tarFile] [FILE] ...
3428 Create, extract, or list files from a tar file. Note that this version of
3429 tar treats hard links as separate files.
3435 Main operation mode:
3458 f name of tarfile or "-" for stdin
3460 --exclude file to exclude
3474 v verbosely list files processed
3488 $ zcat /tmp/tarball.tar.gz | tar -xf -
3489 $ tar -cf /tmp/tarball.tar /usr/local
3496 -------------------------------
3501 </listitem></varlistentry>
3502 <varlistentry><term><emphasis>tee
3505 <listitem><para></para>
3508 Usage: tee [OPTION]... [FILE]...
3514 Copy standard input to each FILE, and also to standard output.
3527 -a append to the given FILEs, do not overwrite
3541 $ echo "Hello" | tee /tmp/foo
3550 -------------------------------
3555 </listitem></varlistentry>
3556 <varlistentry><term><emphasis>telnet
3559 <listitem><para></para>
3562 Usage: telnet host [port]
3568 Telnet is used to establish interactive communication with another computer
3569 over a network using the TELNET protocol.
3575 -------------------------------
3580 </listitem></varlistentry>
3581 <varlistentry><term><emphasis>test, [
3584 <listitem><para></para>
3587 Usage: test EXPRESSION or [ EXPRESSION ]
3593 Checks file types and compares values returning an exit code determined by
3594 the value of EXPRESSION.
3625 -------------------------------
3630 </listitem></varlistentry>
3631 <varlistentry><term><emphasis>touch
3634 <listitem><para></para>
3637 Usage: touch [<emphasis>-c</emphasis>] file [file ...]
3643 Update the last-modified date on (or create) the selected file[s].
3657 /bin/ls: /tmp/foo: No such file or directory
3660 -rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo
3667 -------------------------------
3672 </listitem></varlistentry>
3673 <varlistentry><term><emphasis>tr
3676 <listitem><para></para>
3679 Usage: tr [-cds] STRING1 [STRING2]
3685 Translate, squeeze, and/or delete characters from standard input, writing
3699 -c take complement of STRING1
3700 -d delete input characters coded STRING1
3701 -s squeeze multiple output characters of STRING2 into one character
3715 $ echo "gdkkn vnqkc" | tr [a-y] [b-z]
3723 -------------------------------
3728 </listitem></varlistentry>
3729 <varlistentry><term><emphasis>true
3732 <listitem><para></para>
3735 Returns an exit code of TRUE (0)
3757 -------------------------------
3762 </listitem></varlistentry>
3763 <varlistentry><term><emphasis>tty
3766 <listitem><para></para>
3775 Print the file name of the terminal connected to standard input.
3788 -s print nothing, only return an exit status
3810 -------------------------------
3815 </listitem></varlistentry>
3816 <varlistentry><term><emphasis>umount
3819 <listitem><para></para>
3822 Usage: umount [flags] filesystem|directory
3835 -a: Unmount all file systems
3836 -r: Try to remount devices as read-only if mount is busy
3837 -f: Force filesystem umount (i.e. unreachable NFS server)
3838 -l: Do not free loop device (if a loop device has been used)
3859 -------------------------------
3864 </listitem></varlistentry>
3865 <varlistentry><term><emphasis>uname
3868 <listitem><para></para>
3871 Usage: uname [OPTION]...
3877 Print certain system information. With no OPTION, same as <emphasis>-s</emphasis>.
3890 -a print all information
3891 -m the machine (hardware) type
3892 -n print the machine's network node hostname
3893 -r print the operating system release
3894 -s print the operating system name
3895 -p print the host processor type
3896 -v print the operating system version
3911 Linux debian 2.2.15pre13 #5 Tue Mar 14 16:03:50 MST 2000 i686 unknown
3918 -------------------------------
3923 </listitem></varlistentry>
3924 <varlistentry><term><emphasis>uniq
3927 <listitem><para></para>
3930 Usage: uniq [OPTION]... [INPUT [OUTPUT]]
3936 Discard all but one of successive identical lines from INPUT (or standard
3937 input), writing to OUTPUT (or standard output).
3950 $ echo -e "a\na\nb\nc\nc\na" | sort | uniq
3960 -------------------------------
3965 </listitem></varlistentry>
3966 <varlistentry><term><emphasis>update
3969 <listitem><para></para>
3972 Usage: update [options]
3978 Periodically flushes filesystem buffers.
3991 -S force use of sync(2) instead of flushing
3992 -s SECS call sync this often (default 30)
3993 -f SECS flush some buffers this often (default 5)
4000 -------------------------------
4005 </listitem></varlistentry>
4006 <varlistentry><term><emphasis>uptime
4009 <listitem><para></para>
4018 Tells how long the system has been running since boot.
4032 1:55pm up 2:30, load average: 0.09, 0.04, 0.00
4039 -------------------------------
4044 </listitem></varlistentry>
4045 <varlistentry><term><emphasis>usleep
4048 <listitem><para></para>
4057 Pauses for N microseconds.
4071 [pauses for 1 second]
4078 -------------------------------
4083 </listitem></varlistentry>
4084 <varlistentry><term><emphasis>uudecode
4087 <listitem><para></para>
4090 Usage: uudecode [OPTION] [FILE]
4096 Uudecode a uuencoded file
4109 -o FILE direct output to FILE
4123 $ uudecode -o busybox busybox.uu
4125 -rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox
4132 -------------------------------
4137 </listitem></varlistentry>
4138 <varlistentry><term><emphasis>uuencode
4141 <listitem><para></para>
4144 Usage: uuencode [OPTION] [INFILE] REMOTEFILE
4163 -m use base64 encoding as of RFC1521
4177 $ uuencode busybox busybox
4179 M?T5,1@$!`0````````````(``P`!````L+@$"#0```!0N@,``````#0`(``&
4181 $ uudecode busybox busybox > busybox.uu
4189 -------------------------------
4194 </listitem></varlistentry>
4195 <varlistentry><term><emphasis>wc
4198 <listitem><para></para>
4201 Usage: wc [OPTION]... [FILE]...
4207 Print line, word, and byte counts for each FILE, and a total line if more
4208 than one FILE is specified. With no FILE, read standard input.
4221 -c print the byte counts
4222 -l print the newline counts
4223 -L print the length of the longest line
4224 -w print the word counts
4239 31 46 1365 /etc/passwd
4246 -------------------------------
4251 </listitem></varlistentry>
4252 <varlistentry><term><emphasis>which
4255 <listitem><para></para>
4258 Usage: which [COMMAND ...]
4285 -------------------------------
4290 </listitem></varlistentry>
4291 <varlistentry><term><emphasis>whoami
4294 <listitem><para></para>
4303 Prints the user name associated with the current effective user id.
4324 -------------------------------
4329 </listitem></varlistentry>
4330 <varlistentry><term><emphasis>yes
4333 <listitem><para></para>
4336 Usage: yes [OPTION]... [STRING]...
4342 Repeatedly outputs a line with all specified <literal>STRING(s),</literal>
4349 -------------------------------
4354 </listitem></varlistentry>
4355 <varlistentry><term><emphasis>zcat
4358 <listitem><para></para>
4361 This is essentially an alias for invoking ``gunzip <emphasis>-c</emphasis>'', where it decompresses the file in question and send the output to
4368 -------------------------------
4373 </listitem></varlistentry></variablelist>
4377 <sect1 id="pod2docbook-ch-1-sect-6"><title>LIBC NSS
4380 <!-- Bogus hack to ensure that each sect has a paragraph in it -->
4386 GNU Libc uses the Name Service Switch (NSS) to configure the behavior of
4387 the C library for the local environment, and to configure how it reads
4388 system data, such as passwords and group information. BusyBox has made it
4389 Policy that it will never use NSS, and will never use and libc calls that
4390 make use of NSS. This allows you to run an embedded system without the need
4391 for installing an /etc/nsswitch.conf file and without and /lib/libnss_*
4392 libraries installed.
4398 If you are using a system that is using a remote LDAP server for
4399 authentication via GNU libc NSS, and you want to use BusyBox, then you will
4400 need to adjust the BusyBox source. Chances are though, that if you have
4401 enough space to install of that stuff on your system, then you probably
4402 want the full GNU utilities.
4409 <sect1 id="pod2docbook-ch-1-sect-7"><title>SEE ALSO
4412 <!-- Bogus hack to ensure that each sect has a paragraph in it -->
4418 <literal>textutils(1),</literal> <literal>shellutils(1),</literal> etc...
4425 <sect1 id="pod2docbook-ch-1-sect-8"><title>MAINTAINER
4428 <!-- Bogus hack to ensure that each sect has a paragraph in it -->
4434 Erik Andersen <andersee@debian.org> <andersen@lineo.com>
4441 <sect1 id="pod2docbook-ch-1-sect-9"><title>AUTHORS
4444 <!-- Bogus hack to ensure that each sect has a paragraph in it -->
4450 The following people have contributed code to BusyBox whether they know it
4457 Erik Andersen <andersee@debian.org>
4463 John Beppu <beppu@lineo.com>
4469 Brian Candler <B.Candler@pobox.com>
4475 Randolph Chung <tausq@debian.org>
4481 Dave Cinege <dcinege@psychosis.com>
4487 Karl M. Hegbloom <karlheg@debian.org>
4493 John Lombardo <john@deltanet.com>
4499 Glenn McGrath <bug1@netconnect.com.au>
4505 Bruce Perens <bruce@perens.com>
4511 Pavel Roskin <proski@gnu.org>
4517 Linus Torvalds <torvalds@transmeta.com>
4523 Charles P. Wright <cpwright@villagenet.com>
4529 Enrique Zanardi <ezanardi@ull.es>
4539 </book> <!-- End of the book -->