X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=docs%2Fbusybox.sgml;h=b54d68ee58e01a469c842fa177156c92fc60e631;hb=334dc65c929ee900bf99b1c2b53d1893df3bc95e;hp=a25aa01893651bd65a419bab1df7fe94dab514de;hpb=1b355ebba68bdd567dd3961a18291dfd9532c2e8;p=oweals%2Fbusybox.git diff --git a/docs/busybox.sgml b/docs/busybox.sgml index a25aa0189..b54d68ee5 100644 --- a/docs/busybox.sgml +++ b/docs/busybox.sgml @@ -1,4 +1,4 @@ - + BusyBox - The Swiss Army Knife of Embedded Linux @@ -59,8 +59,8 @@ How to use BusyBox - - Syntax + Syntax @@ -75,7 +75,9 @@ - + + Invoking BusyBox + When you create a link to BusyBox for the function you wish to use, when BusyBox is called using that link it will behave as if the command itself @@ -115,7 +117,9 @@ - + + Common options + Most BusyBox commands support the --help option to provide a terse runtime description of their behavior. @@ -125,26 +129,37 @@ BusyBox Commands - + Available BusyBox Commands Currently defined functions include: - ar, basename, cat, chgrp, chmod, chown, chroot, chvt, clear, - cp, cut, date, dc, dd, deallocvt, df, dirname, dmesg, du, - dumpkmap, dutmp, echo, false, fbset, fdflush, find, free, - freeramdisk, fsck.minix, grep, gunzip, gzip, halt, head, - hostid, hostname, id, init, insmod, kill, killall, length, ln, - loadacm, loadfont, loadkmap, logger, logname, ls, lsmod, - makedevs, mkdir, mkfifo, mkfs.minix, mknod, mkswap, mktemp, - more, mount, mt, mv, nc, nslookup, ping, poweroff, printf, ps, - pwd, reboot, renice, reset, rm, rmdir, rmmod, sed, setkeycodes, sh, sleep, - sort, swapoff, swapon, sync, syslogd, tail, tar, tee, telnet, - test, touch, tr, true, tty, umount, uname, uniq, update, - uptime, usleep, uudecode, uuencode, wc, which, whoami, yes, - zcat, [ + addgroup, adduser, adjtimex, ar, arping, ash, awk, basename, + bunzip2, busybox, bzcat, cal, cat, chgrp, chmod, chown, chroot, + chvt, clear, cmp, cp, cpio, crond, crontab, cut, date, dc, dd, + deallocvt, delgroup, deluser, df, dirname, dmesg, dos2unix, dpkg, + dpkg-deb, du, dumpkmap, dumpleases, dutmp, echo, egrep, env, expr, + false, fbset, fdflush, fdformat, fgrep, find, fold, free, freeramdisk, + fsck.minix, ftpget, ftpput, getopt, getty, grep, gunzip, gzip, + halt, hdparm, head, hexdump, hostid, hostname, httpd, hush, hwclock, + id, ifconfig, ifdown, ifup, inetd, init, insmod, ip, ipcalc, iplink, + iproute, iptunnel, kill, killall, klogd, lash, length, linuxrc, + ln, loadfont, loadkmap, logger, login, logname, logread, + losetup, ls, lsmod, makedevs, md5sum, mesg, minit, mkdir, mkfifo, + mkfs.minix, mknod, mkswap, mktemp, modprobe, more, mount, msh, + msvc, mt, mv, nameif, nc, netstat, nslookup, od, openvt, passwd, + patch, pidfilehack, pidof, ping, ping6, pivot_root, poweroff, + printf, ps, pwd, rdate, readlink, realpath, reboot, renice, reset, + rm, rmdir, rmmod, route, rpm, rpm2cpio, run-parts, sed, setkeycodes, + sha1sum, sleep, sort, start-stop-daemon, strings, stty, su, sulogin, + swapoff, swapon, sync, syslogd, tail, tar, tee, telnet, telnetd, + test, tftp, time, top, touch, tr, traceroute, true, tty, udhcpc, + udhcpd, umount, uname, uncompress, uniq, unix2dos, unzip, + uptime, usleep, uudecode, uuencode, vconfig, vi, vlock, watch, + watchdog, wc, wget, which, who, whoami, xargs, yes, zcat, [ + @@ -741,6 +756,57 @@ + + dos2unix + + + Usage: dos2unix < dosfile > unixfile + + + + Converts a text file from dos format to unix format. + + + + + + dpkg-deb + + + Usage: dpkg-deb [OPTION] archive [directory] + + + + Debian package archive (.deb) manipulation tool + + + + Options: + + + + + -c List the contents of the filesystem tree archive portion of the package + -e Extracts the control information files from a package archive into the specified directory. + If no directory is specified then a subdirectory DEBIAN in the current directory is used. + -x Silently extracts the filesystem tree from a package archive into the specified directory. + -X Extracts the filesystem tree from a package archive into the specified directory, listing the files as it goes. + If required the specified directory (but not its parents) will be created. + + + + + Example: + + + + + dpkg-deb -e ./busybox_0.48-1_i386.deb + dpkg-deb -x ./busybox_0.48-1_i386.deb ./unpack_dir + + + + du @@ -750,7 +816,7 @@ Summarize the disk space used for each FILE or current - directory. Disk space printed in units of 1k (i.e. + directory. Disk space printed in units of 1k (i.e., 1024 bytes). @@ -794,7 +860,7 @@ - Prints out a binary keyboard translation table to standard input. + Prints out a binary keyboard translation table to standard output. @@ -1033,7 +1099,9 @@ -follow Dereference symbolic links -name PATTERN File name (leading directories removed) matches PATTERN - -print Print the full file name followed by a newline to stdout + -type X Filetype matches X (where X is one of: f,d,l,b,c,...) + -perm PERMS Permissions match any of (+NNN); all of (-NNN); or exactly (NNN) + -mtime TIME Modified time is greater than (+N); less than (-N); or exactly (N) days @@ -1261,7 +1329,7 @@ -< + gzip @@ -1280,6 +1348,7 @@ -c Write output to standard output + -d decompress @@ -1380,10 +1449,10 @@ - -s Short - -i Addresses for the hostname - -d DNS domain name - -F FILE Use the contents of FILE to specify the hostname + -s Short + -i Addresses for the hostname + -d DNS domain name + -F, --file FILE Use the contents of FILE to specify the hostname @@ -1418,6 +1487,7 @@ -g Print only the group ID -u Print only the user ID + -n print a name instead of a number (with for -ug) -r Print the real user ID instead of the effective ID (with -ug) @@ -1489,24 +1559,23 @@ <id>:<runlevels>:<action>:<process> - + id - WARNING: This field has a non-traditional - meaning for BusyBox init! The id field is used - by BusyBox init to specify the controlling tty - for the specified process to run on. The - contents of this field are appended to "/dev/" - and used as-is. There is no need for this field - to be unique, although if it isn't you may have - strange results. If this field is left blank, - it is completely ignored. Also note that if - BusyBox detects that a serial console is in use, - then all entries containing non-empty id fields - will _not_ be run. BusyBox init does nothing - with utmp. We don't need no stinkin' utmp. + + WARNING: This field has a non-traditional meaning for BusyBox init! + The id field is used by BusyBox init to specify the controlling tty + for the specified process to run on. The contents of this field + are appended to "/dev/" and used as-is. There is no need for this + field to be unique, although if it isn't you may have strange + results. If this field is left blank, the controlling tty is set + to the console. Also note that if BusyBox detects that a serial + console is in use, then only entries whose controlling tty is + either the serial console or /dev/null will be run. BusyBox init + does nothing with utmp. We don't need no stinkin' utmp. + @@ -1521,24 +1590,56 @@ action + + + Valid actions include: sysinit, respawn, askfirst, wait, + once, and ctrlaltdel. + + + + + The available actions can be classified into two groups: actions + that are run only once, and actions that are re-run when the specified + process exits. + + + + Run only-once actions: + + + + 'sysinit' is the first item run on boot. init waits until all + sysinit actions are completed before continuing. Following the + completion of all sysinit actions, all 'wait' actions are run. + 'wait' actions, like 'sysinit' actions, cause init to wait until + the specified task completes. 'once' actions are asyncronous, + therefore, init does not wait for them to complete. 'ctrlaltdel' + actions are run immediately before init causes the system to reboot + (unmounting filesystems with a 'ctrlaltdel' action is a very good + idea). + + - Valid actions include: sysinit, respawn, - askfirst, wait, once, and ctrlaltdel. + Run repeatedly actions: - askfirst acts just like respawn, but before - running the specified process it displays the - line "Please press Enter to activate this - console." and then waits for the user to press - enter before starting the specified process. + 'respawn' actions are run after the 'once' actions. When a process + started with a 'respawn' action exits, init automatically restarts + it. Unlike sysvinit, BusyBox init does not stop processes from + respawning out of control. The 'askfirst' actions acts just like + respawn, except that before running the specified process it + displays the line "Please press Enter to activate this console." + and then waits for the user to press enter before starting the + specified process. - Unrecognized actions (like initdefault) will - cause init to emit an error message, and then go - along with its business. + Unrecognized actions (like initdefault) will cause init to emit an + error message, and then go along with its business. All actions are + run in the reverse order from how they appear in /etc/inittab. + @@ -1550,41 +1651,43 @@ - - Example /etc/inittab file: - - - - - # This is run first except when booting in single-user mode. - # - ::sysinit:/etc/init.d/rcS - - # /bin/sh invocations on selected ttys - # - # Start an "askfirst" shell on the console (whatever that may be) - ::askfirst:/bin/sh - # Start an "askfirst" shell on /dev/tty2 - tty2::askfirst:/bin/sh - - # /sbin/getty invocations for selected ttys - # - tty4::respawn:/sbin/getty 38400 tty4 - tty5::respawn:/sbin/getty 38400 tty5 - - # Example of how to put a getty on a serial line (for a terminal) - # - #ttyS0::respawn:/sbin/getty -L ttyS0 9600 vt100 - #ttyS1::respawn:/sbin/getty -L ttyS1 9600 vt100 - # - # Example how to put a getty on a modem line. - #ttyS2::respawn:/sbin/getty -x0 -s 57600 ttyS2 - - # Stuff to do before rebooting - ::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1 - ::ctrlaltdel:/sbin/swapoff -a > /dev/null 2>&1 - - + + Example /etc/inittab file + + + + # This is run first except when booting in single-user mode. + # + ::sysinit:/etc/init.d/rcS + + # /bin/sh invocations on selected ttys + # + # Start an "askfirst" shell on the console (whatever that may be) + ::askfirst:-/bin/sh + # Start an "askfirst" shell on /dev/tty2-4 + tty2::askfirst:-/bin/sh + tty2::askfirst:-/bin/sh + tty2::askfirst:-/bin/sh + + # /sbin/getty invocations for selected ttys + # + tty4::respawn:/sbin/getty 38400 tty5 + tty5::respawn:/sbin/getty 38400 tty6 + + # Example of how to put a getty on a serial line (for a terminal) + # + #::respawn:/sbin/getty -L ttyS0 9600 vt100 + #::respawn:/sbin/getty -L ttyS1 9600 vt100 + # + # Example how to put a getty on a modem line. + #::respawn:/sbin/getty 57600 ttyS2 + + # Stuff to do before rebooting + ::ctrlaltdel:/bin/umount -a -r + ::ctrlaltdel:/sbin/swapoff + + + @@ -1608,6 +1711,7 @@ -k Make module autoclean-able. -v Verbose output -x Do not export externs + -L Prevent simultaneous loads of the same module @@ -1747,28 +1851,6 @@ - - loadacm - - - Usage: loadacm - - - - Load an acm from stdin. - - - - Example: - - - - - $ loadacm < /etc/i18n/acmname - - - - loadfont @@ -1821,7 +1903,7 @@ - Write MESSAGE to the system log. If MESSAGE is '-', log + Write MESSAGE to the system log. If MESSAGE is omitted, log stdin. @@ -1872,6 +1954,38 @@ + + logread + + + Usage: logread [OPTION]... + + + + Shows the messages from syslogd (using circular buffer). + + + + Options: + + + + + -f Output data as the log grows. + + + + + Example: + + + + + $ logread + + + + ls @@ -1903,6 +2017,7 @@ -A Do not list implied . and .. -C List entries by columns -F Append indicator (one of */=@|) to entries + -L list entries pointed to by symbolic links -R List subdirectories recursively @@ -2191,7 +2306,7 @@ Creates a temporary file with its name based on - TEMPLATE. TEMPLATE is any name with six `Xs' (i.e. + TEMPLATE. TEMPLATE is any name with six `Xs' (i.e., /tmp/temp.XXXXXX). @@ -2358,7 +2473,12 @@ - Open a pipe to HOST:PORT. + or: nc -p PORT -l + + + + + Open a pipe to HOST:PORT or listen for a connection on PORT. @@ -2629,6 +2749,7 @@ + -i Always prompt before removing each destinations -f Remove existing destinations, never prompt -r or -R Remove the contents of directories recursively @@ -2684,7 +2805,7 @@ - -a Try to remove all unused kernel modules + -a Remove all unused modules (recursively) @@ -2699,6 +2820,33 @@ + + run-parts + + + Usage: run-parts [-t] [-a ARG] [-u MASK] DIRECTORY + + + + Run a bunch of scripts in a directory. + + + + Options: + + + + + -t Test only. It only print the file to be executed, + without execute them. + -a ARG Pass ARG as an a argument to the programs executed. + -u MASK Set the umask to MASK before executing the programs. + + + + + + sed @@ -2970,7 +3118,9 @@ -n Run as a foreground process -K Do not start up the klogd process -O FILE Use an alternate log file (default=/var/log/messages) - -R HOST[:PORT] Log messages to HOST on PORT (default=514) over UDP. + -R HOST[:PORT] Log remotely to IP or hostname on PORT (default PORT=514/UDP) + -L Log locally as well as network logging (default is network only) + -C [size(KiB)] Log to a circular buffer. Read this buffer using 'logread' @@ -3128,8 +3278,8 @@ - or: [ EXPRESSION ] + Check file types and compare values returning an exit @@ -3306,7 +3456,7 @@ -a Unmount all file systems -r Try to remount devices as read-only if mount is busy - -f Force filesystem umount (i.e. unreachable NFS server) + -f Force filesystem umount (i.e., unreachable NFS server) -l Do not free loop device (if a loop device has been used) @@ -3374,6 +3524,18 @@ INPUT (or stdin), writing to OUTPUT (or stdout). + + Options: + + + + + -c prefix lines by the number of occurrences + -d only print duplicate lines + -u only print unique lines + + + Example: @@ -3387,6 +3549,32 @@ + + + unix2dos + + + Usage: unix2dos < unixfile > dosfile + + + + Converts a text file from unix format to dos format. + + + + + + unrpm + + + Usage: unrpm < package.rpm | gzip -d | cpio -idmuv + + + + Extracts an rpm archive. + + + update @@ -3529,6 +3717,18 @@ + + watchdog + + + Usage: watchdog device + + + + Periodically writes to watchdog device B. + + + wc @@ -3614,6 +3814,40 @@ + + xargs + + + Usage: xargs [OPTIONS] [COMMAND] [ARGS...] + + + + Executes COMMAND on every item given by standard input. + + + + Options: + + + + + -t Print the command just before it is run + + + + + + Example: + + + + + $ ls | xargs gzip + $ find . -name '*.c' -print | xargs rm + + + + yes @@ -3696,7 +3930,7 @@ MAINTAINER - Erik Andersen <andersee@debian.org> <andersen@lineo.com> + Erik Andersen <andersen@codepoet.org> @@ -3704,16 +3938,20 @@ AUTHORS - The following people have contributed code to BusyBox whether - they know it or not. + The following people have made significant contributions to + BusyBox -- whether they know it or not. - Erik Andersen <andersee@debian.org> + Erik Andersen <andersen@codepoet.org> - John Beppu <beppu@lineo.com> + Edward Betts <edward@debian.org> + + + + John Beppu <beppu@codepoet.org> @@ -3732,6 +3970,14 @@ Karl M. Hegbloom <karlheg@debian.org> + + Daniel Jacobowitz <dan@debian.org> + + + + Matt Kraai <kraai@alumni.carnegiemellon.edu> + + John Lombardo <john@deltanet.com> @@ -3744,14 +3990,26 @@ Bruce Perens <bruce@perens.com> + + Chip Rosenthal <chip@unicom.com>, <crosenth@covad.com> + + Pavel Roskin <proski@gnu.org> + + Gyepi Sam <gyepi@praxis-sw.com> + + Linus Torvalds <torvalds@transmeta.com> + + Mark Whitley <markw@codepoet.org> + + Charles P. Wright <cpwright@villagenet.com> @@ -3759,5 +4017,11 @@ Enrique Zanardi <ezanardi@ull.es> + + + Vladimir Oleynik <dzo@simtreas.ru> + + +