5 BusyBox - The Swiss Army Knife of Embedded Linux
9 BusyBox <function> [arguments...] # or
11 <function> [arguments...] # if symlinked
15 BusyBox combines tiny versions of many common UNIX utilities into a single
16 small executable. It provides minimalist replacements for most of the utilities
17 you usually find in fileutils, shellutils, findutils, textutils, grep, gzip,
18 tar, etc. BusyBox provides a fairly complete POSIX environment for any small
19 or embedded system. The utilities in BusyBox generally have fewer options than
20 their full-featured GNU cousins; however, the options that are included provide
21 the expected functionality and behave very much like their GNU counterparts.
23 BusyBox has been written with size-optimization and limited resources in mind.
24 It is also extremely modular so you can easily include or exclude commands (or
25 features) at compile time. This makes it easy to customize your embedded
26 systems. To create a working system, just add a kernel, a shell (such as ash),
27 and an editor (such as elvis-tiny or ae).
31 When you create a link to BusyBox for the function you wish to use, when BusyBox
32 is called using that link it will behave as if the command itself has been invoked.
39 will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiled
42 You can also invoke BusyBox by issuing the command as an argument on the
43 command line. For example, entering
47 will also cause BusyBox to behave as 'ls'.
51 Most BusyBox commands support the B<--help> option to provide a
52 terse runtime description of their behavior.
56 Currently defined functions include:
58 ar, basename, busybox, cat, chgrp, chmod, chown, chroot, chvt, clear, cmp, cp,
59 cut, date, dc, dd, deallocvt, df, dirname, dmesg, dos2unix, dpkg, dpkg-deb, du,
60 dumpkmap, dutmp, echo, expr, false, fbset, fdflush, find, free, freeramdisk,
61 fsck.minix, getopt, grep, gunzip, gzip, halt, head, hostid, hostname, id,
62 ifconfig, init, insmod, kill, killall, klogd, length, ln, loadacm, loadfont,
63 loadkmap, logger, logname, ls, lsmod, makedevs, md5sum, mkdir, mkfifo,
64 mkfs.minix, mknod, mkswap, mktemp, more, mount, mt, mv, nc, nslookup, ping,
65 pivot_root, poweroff, printf, ps, pwd, rdate, readlink, reboot, renice, reset,
66 rm, rmdir, rmmod, route, rpmunpack, sed, setkeycodes, sh, sleep, sort, stty,
67 swapoff, swapon, sync, syslogd, tail, tar, tee, telnet, test, tftp, touch, tr,
68 true, tty, umount, uname, uniq, unix2dos, update, uptime, usleep, uudecode,
69 uuencode, watchdog, wc, wget, which, whoami, xargs, yes, zcat, [
75 adjtimex [B<-q>] [B<-o> offset] [B<-f> frequency] [B<-p> timeconstant] [B<-t> tick]
77 Reads and optionally sets system timebase parameters.
82 -q quiet mode - do not print
83 -o offset time offset, microseconds
84 -f frequency frequency adjust, integer kernel units (65536 is 1ppm)
85 (positive values make the system clock run fast)
86 -t tick microseconds per tick, usually 10000
89 -------------------------------
93 ar -[ovR]{ptx} archive filenames
95 Extract or list files from an ar archive.
99 -o preserve original dates
103 -v verbosely list files processed
106 -------------------------------
110 basename FILE [SUFFIX]
112 Strips directory path and suffixes from FILE.
113 If specified, also removes any trailing SUFFIX.
117 $ basename /usr/local/bin/foo
119 $ basename /usr/local/bin/
121 $ basename /foo/bar.txt .txt
124 -------------------------------
130 Concatenates FILE(s) and prints them to stdout.
137 -------------------------------
141 chgrp [OPTION]... GROUP FILE...
143 Change the group membership of each FILE to GROUP.
147 -R Changes files and directories recursively.
152 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
153 $ chgrp root /tmp/foo
155 -r--r--r-- 1 andersen root 0 Apr 12 18:25 /tmp/foo
157 -------------------------------
161 chmod [B<-R>] MODE[,MODE]... FILE...
163 Each MODE is one or more of the letters ugoa, one of the
164 symbols +-= and one or more of the letters rwxst.
168 -R Changes files and directories recursively.
173 -rw-rw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo
176 -rwxrw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo*
179 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
181 -------------------------------
185 chown [OPTION]... OWNER[<.|:>[GROUP]] FILE...
187 Change the owner and/or group of each FILE to OWNER and/or GROUP.
191 -R Changes files and directories recursively.
196 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
197 $ chown root /tmp/foo
199 -r--r--r-- 1 root andersen 0 Apr 12 18:25 /tmp/foo
200 $ chown root.root /tmp/foo
202 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
204 -------------------------------
208 chroot NEWROOT [COMMAND...]
210 Run COMMAND with root directory set to NEWROOT.
215 lrwxrwxrwx 1 root root 12 Apr 13 00:46 /bin/ls -> /BusyBox
216 $ mount /dev/hdc1 /mnt -t minix
219 -rwxr-xr-x 1 root root 40816 Feb 5 07:45 /bin/ls*
221 -------------------------------
227 Changes the foreground virtual terminal to /dev/ttyN
229 -------------------------------
237 -------------------------------
245 -------------------------------
249 cp [OPTION]... SOURCE DEST
251 Copies SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
255 -p Preserves file attributes if possible
256 -f force (implied; ignored) - always set
257 -R Copies directories recursively
259 -------------------------------
263 cut [OPTION]... [FILE]...
265 Prints selected fields from each input FILE to standard output.
269 -b LIST Output only bytes from LIST
270 -c LIST Output only characters from LIST
271 -d CHAR Use CHAR instead of tab as the field delimiter
272 -s Output only the lines containing delimiter
273 -f N Print only these fields
278 $ echo Hello world | cut -f 1 -d ' '
280 $ echo Hello world | cut -f 2 -d ' '
283 -------------------------------
287 date [OPTION]... [+FORMAT]
289 Displays the current time in the given FORMAT, or sets the system date.
293 -R Outputs RFC-822 compliant date string
294 -d STRING display time described by STRING, not `now'
295 -s Sets time described by STRING
296 -u Prints or sets Coordinated Universal Time
301 Wed Apr 12 18:52:41 MDT 2000
303 -------------------------------
309 This is a Tiny RPN calculator that understands the
310 following operations: +, -, /, *, and, or, not, eor.
311 i.e. 'dc 2 2 add' -> 4, and 'dc 8 8 \* 2 2 + /' -> 16
323 $ echo 72 9 div 8 mul | dc
326 -------------------------------
330 dd [if=FILE] [of=FILE] [bs=N] [count=N] [skip=N]
331 [seek=N] [conv=notrunc|sync]
333 Copy a file, converting and formatting according to options
335 if=FILE read from FILE instead of stdin
336 of=FILE write to FILE instead of stdout
337 bs=N read and write N bytes at a time
338 count=N copy only N input blocks
339 skip=N skip N input blocks
340 seek=N skip N output blocks
341 conv=notrunc don't truncate output file
342 conv=sync pad blocks with zeros
344 Numbers may be suffixed by c (x1), w (x2), b (x512), kD (x1000), k (x1024),
345 MD (x1000000), M (x1048576), GD (x1000000000) or G (x1073741824).
349 $ dd if=/dev/zero of=/dev/ram1 bs=1M count=4
353 -------------------------------
359 Deallocate unused virtual terminal /dev/ttyN
361 -------------------------------
365 df [B<-hmk>] [filesystem ...]
367 Print the filesystem space used and space available.
371 -h print sizes in human readable format (e.g., 1K 243M 2G )
372 -m print sizes in megabytes
373 -k print sizes in kilobytes(default)
378 Filesystem 1k-blocks Used Available Use% Mounted on
379 /dev/sda3 8690864 8553540 137324 98% /
380 /dev/sda1 64216 36364 27852 57% /boot
382 Filesystem 1k-blocks Used Available Use% Mounted on
383 /dev/sda3 8690864 8553540 137324 98% /
385 -------------------------------
389 dirname [FILENAME ...]
391 Strips non-directory suffix from FILENAME
400 -------------------------------
404 dmesg [B<-c>] [B<-n> LEVEL] [B<-s> SIZE]
406 Prints or controls the kernel ring buffer
410 -c Clears the ring buffer's contents after printing
411 -n LEVEL Sets console logging level
412 -s SIZE Use a buffer of size SIZE
414 -------------------------------
418 dos2unix [option] [file]
420 Converts a text file to/from dos format to unix format.
424 -u output will be in UNIX format
425 -d output will be in DOS format
427 - when no option is given then input format will be automaticaly detected
429 and converted to the oposite format on output
430 - when no file is given, then stdin is used as input and stdout as output
432 -------------------------------
436 dpkg [B<-i>|B<-r>|-B<-unpack>|-B<-configure>] my.deb
438 WORK IN PROGRESS, only usefull for debian-installer
440 -------------------------------
444 dpkg_deb [B<-cexX>] file directory
446 Perform actions on debian packages (.debs)
450 -c List contents of filesystem tree (verbose)
451 -l List contents of filesystem tree (.list format)
452 -e Extract control files to directory
453 -x Exctract packages filesystem tree to directory
458 $ dpkg-deb -X ./busybox_0.48-1_i386.deb /tmp
460 -------------------------------
464 du [B<-lshmk>] [FILE]...
466 Summarizes disk space used for each FILE and/or directory.
467 Disk space is printed in units of 1024 bytes.
471 -l count sizes many times if hard linked
472 -s display only a total for each argument
473 -h print sizes in human readable format (e.g., 1K 243M 2G )
474 -m print sizes in megabytes
475 -k print sizes in kilobytes(default)
481 12 ./kernel-patches/CVS
491 -------------------------------
497 Prints out a binary keyboard translation table to standard output.
503 -------------------------------
509 Dump utmp file format (pipe delimited) from FILE
510 or stdin to stdout. (i.e. 'dutmp /var/run/utmp')
514 $ dutmp /var/run/utmp
515 8|7||si|||0|0|0|955637625|760097|0
516 2|0|~|~~|reboot||0|0|0|955637625|782235|0
517 1|20020|~|~~|runlevel||0|0|0|955637625|800089|0
518 8|125||l4|||0|0|0|955637629|998367|0
519 6|245|tty1|1|LOGIN||0|0|0|955637630|998974|0
520 6|246|tty2|2|LOGIN||0|0|0|955637630|999498|0
521 7|336|pts/0|vt00andersen|andersen|:0.0|0|0|0|955637763|0|0
523 -------------------------------
527 echo [B<-neE>] [ARG ...]
529 Prints the specified ARGs to stdout
533 -n suppress trailing newline
534 -e interpret backslash-escaped characters (i.e. \t=tab etc)
535 -E disable interpretation of backslash-escaped characters
554 -------------------------------
558 env [-] [B<-iu>] [name=value ...] [command]
560 Prints the current environment or runs a program after setting
561 up the specified environment.
565 -, -i start with an empty environment
566 -u remove variable from the environment
568 -------------------------------
574 Prints the value of EXPRESSION to standard output.
578 ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2
579 ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0
580 ARG1 < ARG2 ARG1 is less than ARG2
581 ARG1 <= ARG2 ARG1 is less than or equal to ARG2
582 ARG1 = ARG2 ARG1 is equal to ARG2
583 ARG1 != ARG2 ARG1 is unequal to ARG2
584 ARG1 >= ARG2 ARG1 is greater than or equal to ARG2
585 ARG1 > ARG2 ARG1 is greater than ARG2
586 ARG1 + ARG2 arithmetic sum of ARG1 and ARG2
587 ARG1 - ARG2 arithmetic difference of ARG1 and ARG2
588 ARG1 * ARG2 arithmetic product of ARG1 and ARG2
589 ARG1 / ARG2 arithmetic quotient of ARG1 divided by ARG2
590 ARG1 % ARG2 arithmetic remainder of ARG1 divided by ARG2
591 STRING : REGEXP anchored pattern match of REGEXP in STRING
592 match STRING REGEXP same as STRING : REGEXP
593 substr STRING POS LENGTH substring of STRING, POS counted from 1
594 index STRING CHARS index in STRING where any CHARS is found,
596 length STRING length of STRING
597 quote TOKEN interpret TOKEN as a string, even if
598 it is a keyword like `match' or an
600 ( EXPRESSION ) value of EXPRESSION
602 Beware that many operators need to be escaped or quoted for shells.
603 Comparisons are arithmetic if both ARGs are numbers, else
604 lexicographical. Pattern matches return the string matched between
605 \( and \) or null; if \( and \) are not used, they return the number
606 of characters matched or 0.
608 -------------------------------
614 Return an exit code of FALSE (1).
622 -------------------------------
626 fbset [options] [mode]
628 Show and modify frame buffer settings
634 # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz
635 geometry 1024 768 1024 768 16
636 timings 12714 128 32 16 4 128 4
638 rgba 5/11,6/5,5/0,0/0
641 -------------------------------
647 Forces floppy disk drive to detect disk change
649 -------------------------------
653 find [PATH...] [EXPRESSION]
655 Search for files in a directory hierarchy. The default PATH is
656 the current directory; default EXPRESSION is 'B<-print>'
658 EXPRESSION may consist of:
660 -follow Dereference symbolic links.
661 -name PATTERN File name (leading directories removed) matches PATTERN. -print Print (default and assumed).
663 -type X Filetype matches X (where X is one of: f,d,l,b,c,...)
664 -perm PERMS Permissions match any of (+NNN); all of (-NNN);
666 -mtime TIME Modified time is greater than (+N); less than (-N);
671 $ find / -name /etc/passwd
674 -------------------------------
680 Displays the amount of free and used system memory
685 total used free shared buffers
686 Mem: 257628 248724 8904 59644 93124
687 Swap: 128516 8404 120112
688 Total: 386144 257128 129016
691 -------------------------------
697 Frees all memory used by the specified ramdisk.
701 $ freeramdisk /dev/ram2
703 -------------------------------
707 fsck_minix [B<-larvsmf>] /dev/name
709 Performs a consistency check for MINIX filesystems.
713 -l Lists all filenames
714 -r Perform interactive repairs
715 -a Perform automatic repairs
717 -s Outputs super-block information
718 -m Activates MINIX-like mode not cleared warnings
719 -f Force file system check.
721 -------------------------------
727 Parse command options
729 -a, --alternative Allow long options starting with single -
730 -l, --longoptions=longopts Long options to be recognized
731 -n, --name=progname The name under which errors are reported
732 -o, --options=optstring Short options to be recognized
733 -q, --quiet Disable error reporting by getopt(3)
734 -Q, --quiet-output No normal output
735 -s, --shell=shell Set shell quoting conventions
736 -T, --test Test for getopt(1) version
737 -u, --unqote Do not quote the output
743 GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \
744 -n 'example.busybox' -- $@`
745 if [ $? != 0 ] ; then exit 1 ; fi
749 -a|--a-long) echo Option a ; shift ;;
750 -b|--b-long) echo Option b, argument `$2' ; shift 2 ;;
753 \) echo Option c, no argument; shift 2 ;;
754 *) echo Option c, argument `$2' ; shift 2 ;;
757 *) echo Internal error! ; exit 1 ;;
761 -------------------------------
765 grep [B<-ihHnqvs>] pattern [files...]
767 Search for PATTERN in each FILE or standard input.
771 -H prefix output lines with filename where match was found
772 -h suppress the prefixing filename on output
773 -i ignore case distinctions
774 -n print line number with output lines
775 -q be quiet. Returns 0 if result was found, 1 otherwise
776 -v select non-matching lines
777 -s suppress file open/read error messages
781 $ grep root /etc/passwd
782 root:x:0:0:root:/root:/bin/bash
783 $ grep ^[rR]oo. /etc/passwd
784 root:x:0:0:root:/root:/bin/bash
786 -------------------------------
790 gunzip [OPTION]... FILE
792 Uncompress FILE (or standard input if FILE is '-').
796 -c Write output to standard output
797 -t Test compressed file integrity
801 $ ls -la /tmp/BusyBox*
802 -rw-rw-r-- 1 andersen andersen 557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz
803 $ gunzip /tmp/BusyBox-0.43.tar.gz
804 $ ls -la /tmp/BusyBox*
805 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
807 -------------------------------
811 gzip [OPTION]... FILE
813 Compress FILE with maximum compression.
814 When FILE is '-', reads standard input. Implies B<-c>.
818 -c Write output to standard output instead of FILE.gz
823 $ ls -la /tmp/BusyBox*
824 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
825 $ gzip /tmp/BusyBox-0.43.tar
826 $ ls -la /tmp/BusyBox*
827 -rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/BusyBox-0.43.tar.gz
829 -------------------------------
837 -------------------------------
841 head [OPTION] [FILE]...
843 Print first 10 lines of each FILE to standard output.
844 With more than one FILE, precede each with a header giving the
845 file name. With no FILE, or when FILE is -, read standard input.
849 -n NUM Print first NUM lines instead of first 10
853 $ head -n 2 /etc/passwd
854 root:x:0:0:root:/root:/bin/bash
855 daemon:x:1:1:daemon:/usr/sbin:/bin/sh
857 -------------------------------
863 Print out a unique 32-bit identifier for the machine.
865 -------------------------------
869 hostname [OPTION] {hostname | B<-F> file}
871 Get or set the hostname or DNS domain name. If a hostname is given
872 (or a file with the B<-F> parameter), the host name will be set.
877 -i Addresses for the hostname
879 -F, --file FILE Use the contents of FILE to specify the hostname
886 -------------------------------
890 id [OPTIONS]... [USERNAME]
892 Print information for USERNAME or the current user
896 -g prints only the group ID
897 -u prints only the user ID
898 -n print a name instead of a number (with for -ug)
899 -r prints the real user ID instead of the effective ID (with -ug)
904 uid=1000(andersen) gid=1000(andersen)
906 -------------------------------
910 ifconfig [B<-a>] <interface> [<address>]
912 configure a network interface
916 [[-]broadcast [<address>]] [[-]pointopoint [<address>]]
917 [netmask <address>] [dstaddr <address>]
918 [outfill <NN>] [keepalive <NN>]
919 [hw ether <address>] [metric <NN>] [mtu <NN>]
920 [[-]trailers] [[-]arp] [[-]allmulti]
921 [multicast] [[-]promisc] [txqueuelen <NN>] [[-]dynamic]
922 [mem_start <NN>] [io_addr <NN>] [irq <NN>]
925 -------------------------------
931 Init is the parent of all processes.
933 This version of init is designed to be run only by the kernel.
935 BusyBox init doesn't support multiple runlevels. The runlevels field of
936 the /etc/inittab file is completely ignored by BusyBox init. If you want
937 runlevels, use sysvinit.
939 BusyBox init works just fine without an inittab. If no inittab is found,
940 it has the following default behavior:
942 ::sysinit:/etc/init.d/rcS
944 ::ctrlaltdel:/sbin/reboot
945 ::shutdown:/sbin/swapoff -a
946 ::shutdown:/bin/umount -a -r
948 if it detects that /dev/console is _not_ a serial console, it will also run:
950 tty2::askfirst:/bin/sh
951 tty3::askfirst:/bin/sh
952 tty4::askfirst:/bin/sh
954 If you choose to use an /etc/inittab file, the inittab entry format is as follows:
956 <id>:<runlevels>:<action>:<process>
960 WARNING: This field has a non-traditional meaning for BusyBox init!
961 The id field is used by BusyBox init to specify the controlling tty for
962 the specified process to run on. The contents of this field are
963 appended to /dev/ and used as-is. There is no need for this field to
964 be unique, although if it isn't you may have strange results. If this
965 field is left blank, the controlling tty is set to the console. Also
966 note that if BusyBox detects that a serial console is in use, then only
967 entries whose controlling tty is either the serial console or /dev/null
968 will be run. BusyBox init does nothing with utmp. We don't need no
973 The runlevels field is completely ignored.
977 Valid actions include: sysinit, respawn, askfirst, wait,
978 once, ctrlaltdel, and shutdown.
980 The available actions can be classified into two groups: actions
981 that are run only once, and actions that are re-run when the specified
984 Run only-once actions:
986 'sysinit' is the first item run on boot. init waits until all
987 sysinit actions are completed before continuing. Following the
988 completion of all sysinit actions, all 'wait' actions are run.
989 'wait' actions, like 'sysinit' actions, cause init to wait until
990 the specified task completes. 'once' actions are asyncronous,
991 therefore, init does not wait for them to complete. 'ctrlaltdel'
992 actions are run when the system detects that someone on the system
993 console has pressed the CTRL-ALT-DEL key combination. Typically one
994 wants to run 'reboot' at this point to cause the system to reboot.
995 Finally the 'shutdown' action specifies the actions to taken when
996 init is told to reboot. Unmounting filesystems and disabling swap
999 Run repeatedly actions:
1001 'respawn' actions are run after the 'once' actions. When a process
1002 started with a 'respawn' action exits, init automatically restarts
1003 it. Unlike sysvinit, BusyBox init does not stop processes from
1004 respawning out of control. The 'askfirst' actions acts just like
1005 respawn, except that before running the specified process it
1006 displays the line Please press Enter to activate this console.
1007 and then waits for the user to press enter before starting the
1010 Unrecognized actions (like initdefault) will cause init to emit an
1011 error message, and then go along with its business. All actions are
1012 run in the reverse order from how they appear in /etc/inittab.
1016 Specifies the process to be executed and it's command line.
1018 Example /etc/inittab file:
1020 # This is run first except when booting in single-user mode.
1022 ::sysinit:/etc/init.d/rcS
1024 # /bin/sh invocations on selected ttys
1026 # Start an askfirst shell on the console (whatever that may be)
1028 # Start an askfirst shell on /dev/tty2-4
1029 tty2::askfirst:-/bin/sh
1030 tty3::askfirst:-/bin/sh
1031 tty4::askfirst:-/bin/sh
1033 # /sbin/getty invocations for selected ttys
1035 tty4::respawn:/sbin/getty 38400 tty5
1036 tty5::respawn:/sbin/getty 38400 tty6
1039 # Example of how to put a getty on a serial line (for a terminal)
1041 #::respawn:/sbin/getty -L ttyS0 9600 vt100
1042 #::respawn:/sbin/getty -L ttyS1 9600 vt100
1044 # Example how to put a getty on a modem line.
1045 #::respawn:/sbin/getty 57600 ttyS2
1047 # Stuff to do before rebooting
1048 ::ctrlaltdel:/sbin/reboot
1049 ::shutdown:/bin/umount -a -r
1050 ::shutdown:/sbin/swapoff -a
1053 -------------------------------
1057 insmod [OPTION]... MODULE [symbol=value]...
1059 Loads the specified kernel modules into the kernel.
1063 -f Force module to load into the wrong kernel version.
1064 -k Make module autoclean-able.
1066 -L Lock to prevent simultaneous loads of a module
1067 -x do not export externs
1069 -------------------------------
1073 kill [B<-signal>] process-id [process-id ...]
1075 Send a signal (default is SIGTERM) to the specified process(es).
1079 -l List all signal names and numbers.
1084 252 root root S [apache]
1085 263 www-data www-data S [apache]
1086 264 www-data www-data S [apache]
1087 265 www-data www-data S [apache]
1088 266 www-data www-data S [apache]
1089 267 www-data www-data S [apache]
1092 -------------------------------
1096 killall [B<-signal>] process-name [process-name ...]
1098 Send a signal (default is SIGTERM) to the specified process(es).
1102 -l List all signal names and numbers.
1109 -------------------------------
1118 -n Run as a foreground process.
1120 -------------------------------
1126 Prints out the length of the specified STRING.
1133 -------------------------------
1137 ln [OPTION] TARGET... LINK_NAME|DIRECTORY
1139 Create a link named LINK_NAME or DIRECTORY to the specified TARGET
1141 You may use '--' to indicate that all following arguments are non-options.
1145 -s make symbolic links instead of hard links
1146 -f remove existing destination files
1147 -n no dereference symlinks - treat like normal file
1151 $ ln -s BusyBox /tmp/ls
1153 lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -> BusyBox*
1156 -------------------------------
1162 Loads an acm from standard input.
1166 $ loadacm < /etc/i18n/acmname
1169 -------------------------------
1175 Loads a console font from standard input.
1179 $ loadfont < /etc/i18n/fontname
1182 -------------------------------
1188 Loads a binary keyboard translation table from standard input.
1192 $ loadkmap < /etc/i18n/lang-keymap
1195 -------------------------------
1199 logger [OPTION]... [MESSAGE]
1201 Write MESSAGE to the system log. If MESSAGE is omitted, log stdin.
1205 -s Log to stderr as well as the system log.
1206 -t Log using the specified tag (defaults to user name).
1207 -p Enter the message with the specified priority.
1208 This may be numerical or a ``facility.level'' pair.
1215 -------------------------------
1221 Print the name of the current user.
1229 -------------------------------
1235 Shows the messages from syslogd (using circular buffer).
1237 -------------------------------
1241 ls [B<-1AacCdeFilnpLRrSsTtuvwxXhk>] [filenames...]
1243 List directory contents
1247 -1 list files in a single column
1248 -A do not list implied . and ..
1249 -a do not hide entries starting with .
1250 -C list entries by columns
1251 -c with -l: show ctime
1252 -d list directory entries instead of contents
1253 -e list both full date and full time
1254 -F append indicator (one of */=@|) to entries
1255 -i list the i-node for each file
1256 -l use a long listing format
1257 -n list numeric UIDs and GIDs instead of names
1258 -p append indicator (one of /=@|) to entries
1259 -L list entries pointed to by symbolic links
1260 -R list subdirectories recursively
1261 -r sort the listing in reverse order
1262 -S sort the listing by file size
1263 -s list the size of each file, in blocks
1264 -T NUM assume Tabstop every NUM columns
1265 -t with -l: show modification time
1266 -u with -l: show access time
1267 -v sort the listing by version
1268 -w NUM assume the terminal is NUM columns wide
1269 -x list entries by lines instead of by columns
1270 -X sort the listing by extension
1271 -h print sizes in human readable format (e.g., 1K 243M 2G )
1272 -k print sizes in kilobytes(default)
1274 -------------------------------
1280 List the currently loaded kernel modules.
1282 -------------------------------
1286 makedevs NAME TYPE MAJOR MINOR FIRST LAST [s]
1288 Creates a range of block or character special files
1292 b: Make a block (buffered) device.
1293 c or u: Make a character (un-buffered) device.
1294 p: Make a named pipe. MAJOR and MINOR are ignored for named pipes.
1296 FIRST specifies the number appended to NAME to create the first device.
1297 LAST specifies the number of the last item that should be created.
1298 If 's' is the last argument, the base device is created as well.
1302 makedevs /dev/ttyS c 4 66 2 63 -> ttyS2-ttyS63
1303 makedevs /dev/hda b 3 0 0 8 s -> hda,hda1-hda8
1307 $ makedevs /dev/ttyS c 4 66 2 63
1308 [creates ttyS2-ttyS63]
1309 $ makedevs /dev/hda b 3 0 0 8 s
1310 [creates hda,hda1-hda8]
1313 -------------------------------
1317 md5sum [OPTION] [FILE]...
1318 or: md5sum [OPTION] B<-c> [FILE]
1320 Print or check MD5 checksums.
1323 With no FILE, or when FILE is -, read standard input.
1325 -b read files in binary mode
1326 -c check MD5 sums against given list
1327 -t read files in text mode (default)
1330 The following two options are useful only when verifying checksums:
1332 -s don't output anything, status code shows success
1333 -w warn about improperly formated MD5 checksum lines
1338 6fd11e98b98a58f64ff3398d7b324003
1340 6fd11e98b98a58f64ff3398d7b324003 busybox
1342 6fd11e98b98a58f64ff3398d7b324003 busybox
1346 -------------------------------
1350 mkdir [OPTION] DIRECTORY...
1352 Create the DIRECTORY(ies), if they do not already exist
1356 -m set permission mode (as in chmod), not rwxrwxrwx - umask
1357 -p no error if existing, make parent directories as needed
1363 /tmp/foo: File exists
1364 $ mkdir /tmp/foo/bar/baz
1365 /tmp/foo/bar/baz: No such file or directory
1366 $ mkdir -p /tmp/foo/bar/baz
1369 -------------------------------
1373 mkfifo [OPTIONS] name
1375 Creates a named pipe (identical to 'mknod name p')
1379 -m create the pipe using the specified mode (default a=rw)
1381 -------------------------------
1385 mkfs_minix [B<-c> | B<-l> filename] [B<-nXX>] [B<-iXX>] /dev/name [blocks]
1387 Make a MINIX filesystem.
1391 -c Check the device for bad blocks
1392 -n [14|30] Specify the maximum length of filenames
1393 -i INODES Specify the number of inodes for the filesystem
1394 -l FILENAME Read the bad blocks list from FILENAME
1395 -v Make a Minix version 2 filesystem
1397 -------------------------------
1401 mknod [OPTIONS] NAME TYPE MAJOR MINOR
1403 Create a special file (block, character, or pipe).
1407 -m create the special file using the specified mode (default a=rw)
1411 b: Make a block (buffered) device.
1412 c or u: Make a character (un-buffered) device.
1413 p: Make a named pipe. MAJOR and MINOR are ignored for named pipes.
1417 $ mknod /dev/fd0 b 2 0
1418 $ mknod -m 644 /tmp/pipe p
1421 -------------------------------
1425 mkswap [B<-c>] [B<-v0>|B<-v1>] device [block-count]
1427 Prepare a disk partition to be used as a swap partition.
1431 -c Check for read-ability.
1432 -v0 Make version 0 swap [max 128 Megs].
1433 -v1 Make version 1 swap [big!] (default for kernels >
1435 block-count Number of block to use (default is entire partition).
1437 -------------------------------
1441 mktemp [B<-q>] TEMPLATE
1443 Creates a temporary file with its name based on TEMPLATE.
1444 TEMPLATE is any name with six `Xs' (i.e. /tmp/temp.XXXXXX).
1448 $ mktemp /tmp/temp.XXXXXX
1450 $ ls -la /tmp/temp.mWiLjM
1451 -rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM
1454 -------------------------------
1460 More is a filter for viewing FILE one screenful at a time.
1467 -------------------------------
1471 mount [flags] device directory [B<-o> options,more-options]
1477 -a: Mount all filesystems in fstab.
1478 -f: Fake Add entry to mount table but don't mount it.
1479 -n: Don't write a mount table entry.
1480 -o option: One of many filesystem options, listed below.
1481 -r: Mount the filesystem read-only.
1482 -t fs-type: Specify the filesystem type.
1483 -w: Mount for reading and writing (default).
1485 Options for use with the B<-o> flag:
1487 async/sync: Writes are asynchronous / synchronous.
1488 atime/noatime: Enable / disable updates to inode access times.
1489 dev/nodev: Allow use of special device files / disallow them.
1490 exec/noexec: Allow use of executable files / disallow them.
1491 loop: Mounts a file via loop device.
1492 suid/nosuid: Allow set-user-id-root programs / disallow them.
1493 remount: Re-mount a mounted filesystem, changing its flags.
1494 ro/rw: Mount for read-only / read-write.
1496 There are EVEN MORE flags that are specific to each filesystem.
1497 You'll have to see the written documentation for those.
1502 /dev/hda3 on / type minix (rw)
1503 proc on /proc type proc (rw)
1504 devpts on /dev/pts type devpts (rw)
1505 $ mount /dev/fd0 /mnt -t msdos -o ro
1506 $ mount /tmp/diskimage /opt -t ext2 -o loop
1509 -------------------------------
1513 mt [B<-f> device] opcode value
1515 Control magnetic tape drive operation
1519 bsf bsfm bsr bss datacompression drvbuffer eof eom erase
1520 fsf fsfm fsr fss load lock mkpart nop offline ras1 ras2
1521 ras3 reset retension rew rewoffline seek setblk setdensity
1522 setpart tell unload unlock weof wset
1524 -------------------------------
1529 or: mv SOURCE... DIRECTORY
1531 Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
1535 $ mv /tmp/foo /bin/bar
1538 -------------------------------
1544 Netcat opens a pipe to IP:port
1548 $ nc foobar.somedomain.com 25
1549 220 foobar ESMTP Exim 3.12 #1 Sat, 15 Apr 2000 00:03:02 -0600
1551 214-Commands supported:
1552 214- HELO EHLO MAIL RCPT DATA AUTH
1553 214 NOOP QUIT RSET HELP
1555 221 foobar closing connection
1558 -------------------------------
1564 Queries the nameserver for the IP address of the given HOST
1568 $ nslookup localhost
1576 -------------------------------
1580 ping [OPTION]... host
1582 Send ICMP ECHO_REQUEST packets to network hosts.
1586 -c COUNT Send only COUNT pings.
1587 -s SIZE Send SIZE data bytes in packets (default=56).
1588 -q Quiet mode, only displays output at start
1594 PING slag (127.0.0.1): 56 data bytes
1595 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=20.1 ms
1597 --- debian ping statistics ---
1598 1 packets transmitted, 1 packets received, 0% packet loss
1599 round-trip min/avg/max = 20.1/20.1/20.1 ms
1602 -------------------------------
1606 pivot_root new_root put_old
1608 Move the current root file system to put_old and make new_root
1609 the new root file system.
1611 -------------------------------
1617 Halt the system and request that the kernel shut off the power.
1619 -------------------------------
1623 printf FORMAT [ARGUMENT...]
1625 Formats and prints ARGUMENT(s) according to FORMAT,
1626 Where FORMAT controls the output exactly as in C printf.
1635 -------------------------------
1641 Report process status
1643 This version of ps accepts no options.
1648 PID Uid Gid State Command
1650 2 root root S [kflushd]
1651 3 root root S [kupdate]
1652 4 root root S [kpiod]
1653 5 root root S [kswapd]
1654 742 andersen andersen S [bash]
1655 743 andersen andersen S -bash
1656 745 root root S [getty]
1657 2990 andersen andersen R ps
1659 -------------------------------
1665 Print the full filename of the current working directory.
1672 -------------------------------
1678 Get and possibly set the system date and time from a remote HOST.
1682 -s Set the system date and time (default).
1683 -p Print the date and time.
1685 -------------------------------
1691 Read a symbolic link.
1693 -------------------------------
1701 -------------------------------
1705 renice priority pid [pid ...]
1707 Changes priority of running processes. Allowed priorities range
1708 from 20 (the process runs only when nothing else is running) to 0
1709 (default priority) to B<-20> (almost nothing else ever gets to run).
1711 -------------------------------
1719 -------------------------------
1723 rm [OPTION]... FILE...
1725 Remove (unlink) the FILE(s). You may use '--' to
1726 indicate that all following arguments are non-options.
1730 -i always prompt before removing each destinations
1731 -f remove existing destinations, never prompt
1732 -r or -R remove the contents of directories recursively
1738 -------------------------------
1742 rmdir [OPTION]... DIRECTORY...
1744 Remove the DIRECTORY(ies), if they are empty.
1750 -------------------------------
1754 rmmod [OPTION]... [MODULE]...
1756 Unloads the specified kernel modules from the kernel.
1760 -a Try to remove all unused kernel modules.
1766 -------------------------------
1770 route [{add|del|flush}]
1772 Edit the kernel's routing tables
1774 -------------------------------
1778 rpmunpack < package.rpm | gunzip | cpio B<-idmuv>
1780 Extracts an rpm archive.
1782 -------------------------------
1786 sed [B<-Vhnef>] pattern [files...]
1790 -n suppress automatic printing of pattern space
1791 -e script add the script to the commands to be executed
1792 -f scriptfile add the contents of script-file to the commands to be executed
1793 -h display this help message
1795 If no B<-e> or B<-f> is given, the first non-option argument is taken as the
1796 sed script to interpret. All remaining arguments are names of input
1797 files; if no input files are specified, then the standard input is read.
1801 $ echo foo | sed -e 's/f[a-zA-Z]o/bar/g'
1804 -------------------------------
1806 =item B<setkeycodes>
1808 setkeycodes SCANCODE KEYCODE ...
1810 Set entries into the kernel's scancode-to-keycode map,
1811 allowing unusual keyboards to generate usable keycodes.
1813 SCANCODE may be either xx or e0xx (hexadecimal),
1814 and KEYCODE is given in decimal
1818 $ setkeycodes e030 127
1820 -------------------------------
1825 or: sh B<-c> command [args]...
1827 lash: The BusyBox LAme SHell (command interpreter)
1829 This command does not yet have proper documentation.
1831 Use lash just as you would use any other shell. It properly handles pipes,
1832 redirects, job control, can be used as the shell for scripts, and has a
1833 sufficient set of builtins to do what is needed. It does not (yet) support
1834 Bourne Shell syntax. If you need things like if-then-else, while, and such
1835 use ash or bash. If you just need a very simple and extremely small shell,
1836 this will do the job.
1838 -------------------------------
1844 Pause for N seconds.
1849 [2 second delay results]
1851 -------------------------------
1855 sort [B<-n>] [B<-r>] [FILE]...
1857 Sorts lines of text in the specified files
1874 -------------------------------
1878 stty [B<-a>|g] [B<-F> device] [SETTING]...
1880 Without arguments, prints baud rate, line discipline,
1881 and deviations from stty sane.
1885 -F device open device instead of stdin
1886 -a print all current settings in human-readable form
1887 -g print in stty-readable form
1888 [SETTING] see documentation
1890 -------------------------------
1894 swapoff [OPTION] [device]
1896 Stop swapping virtual memory pages on the given device.
1900 -a Stop swapping on all swap devices
1902 -------------------------------
1906 swapon [OPTION] [device]
1908 Start swapping virtual memory pages on the given device.
1912 -a Start swapping on all swap devices
1914 -------------------------------
1920 Write all buffered filesystem blocks to disk.
1922 -------------------------------
1928 Linux system and kernel logging utility.
1929 Note that this version of syslogd ignores /etc/syslog.conf.
1933 -m NUM Interval between MARK lines (default=20min, 0=off)
1934 -n Run as a foreground process
1935 -O FILE Use an alternate log file (default=/var/log/messages)
1936 -R HOST[:PORT] Log to IP or hostname on PORT (default PORT=514/UDP)
1937 -L Log locally and via network logging (default is network only)
1941 $ syslogd -R masterlog:514
1942 $ syslogd -R 192.168.1.1:601
1944 -------------------------------
1948 tail [OPTION]... [FILE]...
1950 Print last 10 lines of each FILE to standard output.
1951 With more than one FILE, precede each with a header giving the
1952 file name. With no FILE, or when FILE is -, read standard input.
1956 -c N[kbm] output the last N bytes
1957 -n N[kbm] print last N lines instead of last 10
1958 -f output data as the file grows
1959 -q never output headers giving file names
1960 -s SEC wait SEC seconds between reads with -f
1961 -v always output headers giving file names
1963 If the first character of N (bytes or lines) is a '+', output begins with
1964 the Nth item from the start of each file, otherwise, print the last N items
1965 in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2).
1969 $ tail -n 1 /etc/resolv.conf
1972 -------------------------------
1976 tar -[cxtvO] [-B<-exclude> File] [B<-X> File][B<-f> tarFile] [FILE(s)] ...
1978 Create, extract, or list files from a tar file.
1980 Main operation mode:
1988 f name of tarfile or - for stdin
1990 exclude file to exclude
1991 X file with names to exclude
1995 v verbosely list files processed
1999 $ zcat /tmp/tarball.tar.gz | tar -xf -
2000 $ tar -cf /tmp/tarball.tar /usr/local
2002 -------------------------------
2006 tee [OPTION]... [FILE]...
2008 Copy standard input to each FILE, and also to standard output.
2012 -a append to the given FILEs, do not overwrite
2016 $ echo Hello | tee /tmp/foo
2020 -------------------------------
2026 Telnet is used to establish interactive communication with another
2027 computer over a network using the TELNET protocol.
2029 -------------------------------
2036 Checks file types and compares values returning an exit
2037 code determined by the value of EXPRESSION.
2054 -------------------------------
2058 tftp command SOURCE DEST
2060 Transfers a file from/to a tftp server using octet mode.
2064 get Get file from server SOURCE and store to local DEST.
2065 put Put local file SOURCE to server DEST.
2067 When nameing a server, use the syntax server:file.
2069 -------------------------------
2073 touch [B<-c>] file [file ...]
2075 Update the last-modified date on the given file[s].
2079 -c Do not create any files
2084 /bin/ls: /tmp/foo: No such file or directory
2087 -rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo
2090 -------------------------------
2094 tr [B<-cds>] STRING1 [STRING2]
2096 Translate, squeeze, and/or delete characters from
2097 standard input, writing to standard output.
2101 -c take complement of STRING1
2102 -d delete input characters coded STRING1
2103 -s squeeze multiple output characters of STRING2 into one character
2107 $ echo gdkkn vnqkc | tr [a-y] [b-z]
2111 -------------------------------
2117 Return an exit code of TRUE (0).
2125 -------------------------------
2131 Print the file name of the terminal connected to standard input.
2135 -s print nothing, only return an exit status
2142 -------------------------------
2146 umount [flags] filesystem|directory
2148 Unmount file systems
2152 -a: Unmount all file systems in /etc/mtab
2153 -n: Don't erase /etc/mtab entries
2154 -r: Try to remount devices as read-only if mount is busy
2155 -f: Force filesystem umount (i.e. unreachable NFS server)
2156 -l: Do not free loop device (if a loop device has been used)
2162 -------------------------------
2168 Print certain system information. With no OPTION, same as B<-s>.
2172 -a print all information
2173 -m the machine (hardware) type
2174 -n print the machine's network node hostname
2175 -r print the operating system release
2176 -s print the operating system name
2177 -p print the host processor type
2178 -v print the operating system version
2183 Linux debian 2.2.15pre13 #5 Tue Mar 14 16:03:50 MST 2000 i686 unknown
2186 -------------------------------
2190 uniq [OPTION]... [INPUT [OUTPUT]]
2192 Discard all but one of successive identical lines from INPUT
2193 (or standard input), writing to OUTPUT (or standard output).
2197 -c prefix lines by the number of occurrences
2198 -d only print duplicate lines
2199 -u only print unique lines
2213 -------------------------------
2217 unix2dos [option] [file]
2219 See 'dos2unix -B<-help>' for help!
2221 -------------------------------
2227 Periodically flushes filesystem buffers.
2231 -S force use of sync(2) instead of flushing
2232 -s SECS call sync this often (default 30)
2233 -f SECS flush some buffers this often (default 5)
2235 -------------------------------
2241 Display the time since the last boot.
2246 1:55pm up 2:30, load average: 0.09, 0.04, 0.00
2249 -------------------------------
2255 Pause for N microseconds.
2260 [pauses for 1 second]
2262 -------------------------------
2268 Uudecode a file that is uuencoded.
2272 -o FILE direct output to FILE
2276 $ uudecode -o busybox busybox.uu
2278 -rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox
2281 -------------------------------
2285 uuencode [OPTION] [INFILE] REMOTEFILE
2291 -m use base64 encoding as of RFC1521
2295 $ uuencode busybox busybox
2297 <encoded file snipped>
2298 $ uudecode busybox busybox > busybox.uu
2301 -------------------------------
2305 vi [OPTION] [FILE]...
2311 -R Read-only- do not write to the file.
2313 -------------------------------
2319 Periodically write to watchdog device DEV
2321 -------------------------------
2325 wc [OPTION]... [FILE]...
2327 Print line, word, and byte counts for each FILE, and a total line if
2328 more than one FILE is specified. With no FILE, read standard input.
2332 -c print the byte counts
2333 -l print the newline counts
2334 -L print the length of the longest line
2335 -w print the word counts
2340 31 46 1365 /etc/passwd
2343 -------------------------------
2347 wget [B<-c>] [B<-O> file] url
2349 wget retrieves files via HTTP or FTP
2353 -c continue retrieval of aborted transfers
2354 -q quiet mode - do not print
2355 -O save to filename ('-' for stdout)
2357 -------------------------------
2370 -------------------------------
2376 Prints the user name associated with the current effective user id.
2378 -------------------------------
2382 xargs [COMMAND] [ARGS...]
2384 Executes COMMAND on every item given by standard input.
2389 $ find . -name '*.c' -print | xargs rm
2392 -------------------------------
2396 yes [OPTION]... [STRING]...
2398 Repeatedly outputs a line with all specified STRING(s), or 'y'.
2400 -------------------------------
2406 Uncompress to stdout.
2408 -------------------------------
2412 GNU Libc uses the Name Service Switch (NSS) to configure the behavior of the C
2413 library for the local environment, and to configure how it reads system data,
2414 such as passwords and group information. BusyBox has made it Policy that it
2415 will never use NSS, and will never use and libc calls that make use of NSS.
2416 This allows you to run an embedded system without the need for installing an
2417 /etc/nsswitch.conf file and without and /lib/libnss_* libraries installed.
2419 If you are using a system that is using a remote LDAP server for authentication
2420 via GNU libc NSS, and you want to use BusyBox, then you will need to adjust the
2421 BusyBox source. Chances are though, that if you have enough space to install
2422 of that stuff on your system, then you probably want the full GNU utilities.
2426 textutils(1), shellutils(1), etc...
2430 Erik Andersen <andersee@debian.org> <andersen@lineo.com>
2434 The following people have contributed code to BusyBox whether
2435 they know it or not.
2440 Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
2442 Tons of new stuff, major rewrite of most of the
2443 core apps, tons of new apps as noted in header files.
2447 Edward Betts <edward@debian.org>
2449 expr, hostid, logname, tty, wc, whoami, yes
2453 John Beppu <beppu@lineo.com>
2455 du, head, nslookup, sort, tee, uniq
2459 Brian Candler <B.Candler@pobox.com>
2465 Randolph Chung <tausq@debian.org>
2467 fbset, ping, hostname, and mkfifo
2471 Dave Cinege <dcinege@psychosis.com>
2473 more(v2), makedevs, dutmp, modularization, auto links file,
2474 various fixes, Linux Router Project maintenance
2478 Karl M. Hegbloom <karlheg@debian.org>
2480 cp_mv.c, the test suite, various fixes to utility.c, &c.
2484 Daniel Jacobowitz <dan@debian.org>
2490 Matt Kraai <kraai@alumni.carnegiemellon.edu>
2492 documentation, bugfixes
2496 John Lombardo <john@deltanet.com>
2502 Glenn McGrath <bug1@netconnect.com.au>
2508 Bruce Perens <bruce@pixar.com>
2510 Original author of BusyBox. His code is still in many apps.
2514 Chip Rosenthal <chip@unicom.com>, <crosenth@covad.com>
2516 wget - Contributed by permission of Covad Communications
2520 Pavel Roskin <proski@gnu.org>
2522 Lots of bugs fixes and patches.
2526 Gyepi Sam <gyepi@praxis-sw.com>
2528 Remote logging feature for syslogd
2532 Linus Torvalds <torvalds@transmeta.com>
2534 mkswap, fsck.minix, mkfs.minix
2538 Mark Whitley <markw@lineo.com>
2540 sed remix, bug fixes, style-guide, etc.
2544 Charles P. Wright <cpwright@villagenet.com>
2546 gzip, mini-netcat(nc)
2550 Enrique Zanardi <ezanardi@ull.es>
2552 tarcat (since removed), loadkmap, various fixes, Debian maintenance
2556 # $Id: busybox.pod,v 1.96 2001/04/05 21:45:54 andersen Exp $