1# vi: set sw=4 ts=4: 2 3=head1 NAME 4 5BusyBox - The Swiss Army Knife of Embedded Linux 6 7=head1 SYNTAX 8 9 BusyBox <function> [arguments...] # or 10 11 <function> [arguments...] # if symlinked 12 13=head1 DESCRIPTION 14 15BusyBox combines tiny versions of many common UNIX utilities into a single 16small executable. It provides minimalist replacements for most of the utilities 17you usually find in fileutils, shellutils, findutils, textutils, grep, gzip, 18tar, etc. BusyBox provides a fairly complete POSIX environment for any small 19or embedded system. The utilities in BusyBox generally have fewer options than 20their full-featured GNU cousins; however, the options that are included provide 21the expected functionality and behave very much like their GNU counterparts. 22 23BusyBox has been written with size-optimization and limited resources in mind. 24It is also extremely modular so you can easily include or exclude commands (or 25features) at compile time. This makes it easy to customize your embedded 26systems. To create a working system, just add a kernel, a shell (such as ash), 27and an editor (such as elvis-tiny or ae). 28 29=head1 USAGE 30 31When you create a link to BusyBox for the function you wish to use, when BusyBox 32is called using that link it will behave as if the command itself has been invoked. 33 34For example, entering 35 36 ln -s ./BusyBox ls 37 ./ls 38 39will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiled 40into BusyBox). 41 42You can also invoke BusyBox by issuing the command as an argument on the 43command line. For example, entering 44 45 ./BusyBox ls 46 47will also cause BusyBox to behave as 'ls'. 48 49=head1 COMMON OPTIONS 50 51Most BusyBox commands support the B<-h> option to provide a 52terse runtime description of their behavior. 53 54=head1 COMMANDS 55 56Currently defined functions include: 57 58adjtimex, ar, basename, busybox, cat, chgrp, chmod, chown, chroot, chvt, clear, 59cmp, cp, cpio, cut, date, dc, dd, deallocvt, df, dirname, dmesg, dos2unix, dpkg, 60dpkg-deb, du, dumpkmap, dutmp, echo, expr, false, fbset, fdflush, find, free, 61freeramdisk, fsck.minix, getopt, grep, gunzip, gzip, halt, head, hostid, 62hostname, id, ifconfig, init, insmod, kill, killall, klogd, length, ln, 63loadacm, loadfont, loadkmap, logger, logname, ls, lsmod, makedevs, md5sum, 64mkdir, mkfifo, mkfs.minix, mknod, mkswap, mktemp, more, mount, mt, mv, nc, 65nslookup, ping, pivot_root, poweroff, printf, ps, pwd, rdate, readlink, reboot, 66renice, reset, rm, rmdir, rmmod, route, rpm2cpio, rpmunpack, sed, setkeycodes, 67sh, sleep, sort, stty, swapoff, swapon, sync, syslogd, tail, tar, tee, telnet, 68test, tftp, touch, tr, true, tty, umount, uname, uniq, unix2dos, update, uptime, 69usleep, uudecode, uuencode, watchdog, wc, wget, which, whoami, xargs, yes, zcat, 70[ 71 72=over 4 73 74=item B<adjtimex> 75 76adjtimex [B<-q>] [B<-o> offset] [B<-f> frequency] [B<-p> timeconstant] [B<-t> tick] 77 78Reads and optionally sets system timebase parameters. 79See adjtimex(2). 80 81Options: 82 83 -q quiet mode - do not print 84 -o offset time offset, microseconds 85 -f frequency frequency adjust, integer kernel units (65536 is 1ppm) 86 (positive values make the system clock run fast) 87 -t tick microseconds per tick, usually 10000 88 -p timeconstant 89 90------------------------------- 91 92=item B<ar> 93 94ar -[ov][ptx] ARCHIVE FILES 95 96Extract or list FILES from an ar archive. 97 98Options: 99 100 -o preserve original dates 101 -p extract to stdout 102 -t list 103 -x extract 104 -v verbosely list files processed 105 106------------------------------- 107 108=item B<basename> 109 110basename FILE [SUFFIX] 111 112Strips directory path and suffixes from FILE. 113If specified, also removes any trailing SUFFIX. 114 115Example: 116 117 $ basename /usr/local/bin/foo 118 foo 119 $ basename /usr/local/bin/ 120 bin 121 $ basename /foo/bar.txt .txt 122 bar 123 124------------------------------- 125 126=item B<cat> 127 128cat [FILE]... 129 130Concatenates FILE(s) and prints them to stdout. 131 132Example: 133 134 $ cat /proc/uptime 135 110716.72 17.67 136 137------------------------------- 138 139=item B<chgrp> 140 141chgrp [OPTION]... GROUP FILE... 142 143Change the group membership of each FILE to GROUP. 144 145Options: 146 147 -R Changes files and directories recursively. 148 149Example: 150 151 $ ls -l /tmp/foo 152 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo 153 $ chgrp root /tmp/foo 154 $ ls -l /tmp/foo 155 -r--r--r-- 1 andersen root 0 Apr 12 18:25 /tmp/foo 156 157------------------------------- 158 159=item B<chmod> 160 161chmod [B<-R>] MODE[,MODE]... FILE... 162 163Each MODE is one or more of the letters ugoa, one of the 164symbols +-= and one or more of the letters rwxst. 165 166Options: 167 168 -R Changes files and directories recursively. 169 170Example: 171 172 $ ls -l /tmp/foo 173 -rw-rw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo 174 $ chmod u+x /tmp/foo 175 $ ls -l /tmp/foo 176 -rwxrw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo* 177 $ chmod 444 /tmp/foo 178 $ ls -l /tmp/foo 179 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo 180 181------------------------------- 182 183=item B<chown> 184 185chown [ B<-Rh> ]... OWNER[<.|:>[GROUP]] FILE... 186 187Change the owner and/or group of each FILE to OWNER and/or GROUP. 188 189Options: 190 191 -R Changes files and directories recursively. 192 -h Do not dereference symbolic links. 193 194Example: 195 196 $ ls -l /tmp/foo 197 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo 198 $ chown root /tmp/foo 199 $ ls -l /tmp/foo 200 -r--r--r-- 1 root andersen 0 Apr 12 18:25 /tmp/foo 201 $ chown root.root /tmp/foo 202 ls -l /tmp/foo 203 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo 204 205------------------------------- 206 207=item B<chroot> 208 209chroot NEWROOT [COMMAND...] 210 211Run COMMAND with root directory set to NEWROOT. 212 213Example: 214 215 $ ls -l /bin/ls 216 lrwxrwxrwx 1 root root 12 Apr 13 00:46 /bin/ls -> /BusyBox 217 $ mount /dev/hdc1 /mnt -t minix 218 $ chroot /mnt 219 $ ls -l /bin/ls 220 -rwxr-xr-x 1 root root 40816 Feb 5 07:45 /bin/ls* 221 222------------------------------- 223 224=item B<chvt> 225 226chvt N 227 228Changes the foreground virtual terminal to /dev/ttyN 229 230------------------------------- 231 232=item B<clear> 233 234clear 235 236Clear screen. 237 238------------------------------- 239 240=item B<cmp> 241 242cmp FILE1 [FILE2] 243 244 -s quiet mode - do not print 245Compare files. 246 247------------------------------- 248 249=item B<cp> 250 251cp [OPTION]... SOURCE DEST 252 253Copies SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY. 254 255 -a Same as -dpR 256 -d Preserves links 257 -p Preserves file attributes if possible 258 -f force (implied; ignored) - always set 259 -R Copies directories recursively 260 261------------------------------- 262 263=item B<cpio> 264 265cpio -[dimtuv][F cpiofile] 266 267Extract or list files from a cpio archive 268Main operation mode: 269 270 d make leading directories 271 i extract 272 m preserve mtime 273 t list 274 u unconditional overwrite F input from file 275 276------------------------------- 277 278=item B<cut> 279 280cut [OPTION]... [FILE]... 281 282Prints selected fields from each input FILE to standard output. 283 284Options: 285 286 -b LIST Output only bytes from LIST 287 -c LIST Output only characters from LIST 288 -d CHAR Use CHAR instead of tab as the field delimiter 289 -s Output only the lines containing delimiter 290 -f N Print only these fields 291 -n Ignored 292 293Example: 294 295 $ echo "Hello world" | cut -f 1 -d ' ' 296 Hello 297 $ echo "Hello world" | cut -f 2 -d ' ' 298 world 299 300------------------------------- 301 302=item B<date> 303 304date [OPTION]... [+FORMAT] 305 306Displays the current time in the given FORMAT, or sets the system date. 307 308Options: 309 310 -R Outputs RFC-822 compliant date string 311 -d STRING display time described by STRING, not `now' 312 -s Sets time described by STRING 313 -u Prints or sets Coordinated Universal Time 314 315Example: 316 317 $ date 318 Wed Apr 12 18:52:41 MDT 2000 319 320------------------------------- 321 322=item B<dc> 323 324dc expression ... 325 326This is a Tiny RPN calculator that understands the 327following operations: +, -, /, *, and, or, not, eor. 328i.e., 'dc 2 2 add' -> 4, and 'dc 8 8 \* 2 2 + /' -> 16 329 330Example: 331 332 $ dc 2 2 + 333 4 334 $ dc 8 8 * 2 2 + / 335 16 336 $ dc 0 1 and 337 0 338 $ dc 0 1 or 339 1 340 $ echo 72 9 div 8 mul | dc 341 64 342 343------------------------------- 344 345=item B<dd> 346 347dd [if=FILE] [of=FILE] [bs=N] [count=N] [skip=N] 348 [seek=N] [conv=notrunc|sync] 349 350Copy a file, converting and formatting according to options 351 352 if=FILE read from FILE instead of stdin 353 of=FILE write to FILE instead of stdout 354 bs=N read and write N bytes at a time 355 count=N copy only N input blocks 356 skip=N skip N input blocks 357 seek=N skip N output blocks 358 conv=notrunc don't truncate output file 359 conv=sync pad blocks with zeros 360 361Numbers may be suffixed by c (x1), w (x2), b (x512), kD (x1000), k (x1024), 362MD (x1000000), M (x1048576), GD (x1000000000) or G (x1073741824). 363 364Example: 365 366 $ dd if=/dev/zero of=/dev/ram1 bs=1M count=4 367 4+0 records in 368 4+0 records out 369 370------------------------------- 371 372=item B<deallocvt> 373 374deallocvt N 375 376Deallocate unused virtual terminal /dev/ttyN 377 378------------------------------- 379 380=item B<df> 381 382df [B<-hmk>] [FILESYSTEM ...] 383 384Print the filesystem space used and space available. 385 386Options: 387 388 -h print sizes in human readable format (e.g., 1K 243M 2G ) 389 -m print sizes in megabytes 390 -k print sizes in kilobytes(default) 391 392Example: 393 394 $ df 395 Filesystem 1k-blocks Used Available Use% Mounted on 396 /dev/sda3 8690864 8553540 137324 98% / 397 /dev/sda1 64216 36364 27852 57% /boot 398 $ df /dev/sda3 399 Filesystem 1k-blocks Used Available Use% Mounted on 400 /dev/sda3 8690864 8553540 137324 98% / 401 402------------------------------- 403 404=item B<dirname> 405 406dirname [FILENAME ...] 407 408Strips non-directory suffix from FILENAME 409 410Example: 411 412 $ dirname /tmp/foo 413 /tmp 414 $ dirname /tmp/foo/ 415 /tmp 416 417------------------------------- 418 419=item B<dmesg> 420 421dmesg [B<-c>] [B<-n> LEVEL] [B<-s> SIZE] 422 423Prints or controls the kernel ring buffer 424 425Options: 426 427 -c Clears the ring buffer's contents after printing 428 -n LEVEL Sets console logging level 429 -s SIZE Use a buffer of size SIZE 430 431------------------------------- 432 433=item B<dos2unix> 434 435dos2unix [option] [FILE] 436 437Converts FILE from dos format to unix format. When no option 438is given, the input is converted to the opposite output format. 439When no file is given, uses stdin for input and stdout for output. 440 441Options: 442 443 -u output will be in UNIX format 444 -d output will be in DOS format 445 446------------------------------- 447 448=item B<dpkg> 449 450dpkg B<-i> package_file 451 452 453 -i Install the package 454 -C Configure an unpackaged package 455 -P Purge all files of a package 456 -r Remove all but the configuration files for a package 457 -u Unpack a package, but dont configure it 458 459------------------------------- 460 461=item B<dpkg_deb> 462 463dpkg_deb [B<-cefItxX>] FILE [argument] 464 465Perform actions on debian packages (.debs) 466 467Options: 468 469 -c List contents of filesystem tree 470 -e Extract control files to [argument] directory 471 -f Display control field name starting with [argument] 472 -I Display the control filenamed [argument] 473 -t Extract filesystem tree to stdout in tar format 474 -x Extract packages filesystem tree to directory 475 -X Verbose extract 476 477Example: 478 479 $ dpkg-deb -X ./busybox_0.48-1_i386.deb /tmp 480 481------------------------------- 482 483=item B<du> 484 485du [B<-lshmk>] [FILE]... 486 487Summarizes disk space used for each FILE and/or directory. 488Disk space is printed in units of 1024 bytes. 489 490Options: 491 492 -l count sizes many times if hard linked 493 -s display only a total for each argument 494 -h print sizes in human readable format (e.g., 1K 243M 2G ) 495 -m print sizes in megabytes 496 -k print sizes in kilobytes(default) 497 498Example: 499 500 $ du 501 16 ./CVS 502 12 ./kernel-patches/CVS 503 80 ./kernel-patches 504 12 ./tests/CVS 505 36 ./tests 506 12 ./scripts/CVS 507 16 ./scripts 508 12 ./docs/CVS 509 104 ./docs 510 2417 . 511 512------------------------------- 513 514=item B<dumpkmap> 515 516dumpkmap > keymap 517 518Prints out a binary keyboard translation table to standard output. 519 520Example: 521 522 $ dumpkmap > keymap 523 524------------------------------- 525 526=item B<dutmp> 527 528dutmp [FILE] 529 530Dump utmp file format (pipe delimited) from FILE 531or stdin to stdout. (i.e., 'dutmp /var/run/utmp') 532 533Example: 534 535 $ dutmp /var/run/utmp 536 8|7||si|||0|0|0|955637625|760097|0 537 2|0|~|~~|reboot||0|0|0|955637625|782235|0 538 1|20020|~|~~|runlevel||0|0|0|955637625|800089|0 539 8|125||l4|||0|0|0|955637629|998367|0 540 6|245|tty1|1|LOGIN||0|0|0|955637630|998974|0 541 6|246|tty2|2|LOGIN||0|0|0|955637630|999498|0 542 7|336|pts/0|vt00andersen|andersen|:0.0|0|0|0|955637763|0|0 543 544------------------------------- 545 546=item B<echo> 547 548echo [B<-neE>] [ARG ...] 549 550Prints the specified ARGs to stdout 551 552Options: 553 554 -n suppress trailing newline 555 -e interpret backslash-escaped characters (i.e., \t=tab) 556 -E disable interpretation of backslash-escaped characters 557 558Example: 559 560 $ echo "Erik is cool" 561 Erik is cool 562 $ echo -e "Erik\nis\ncool" 563 Erik 564 is 565 cool 566 $ echo "Erik\nis\ncool" 567 Erik\nis\ncool 568 569------------------------------- 570 571=item B<env> 572 573env [B<-iu>] [-] [name=value]... [command] 574 575Prints the current environment or runs a program after setting 576up the specified environment. 577 578Options: 579 580 -, -i start with an empty environment 581 -u remove variable from the environment 582 583------------------------------- 584 585=item B<expr> 586 587expr EXPRESSION 588 589Prints the value of EXPRESSION to standard output. 590 591EXPRESSION may be: 592 593 ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2 594 ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0 595 ARG1 < ARG2 ARG1 is less than ARG2 596 ARG1 <= ARG2 ARG1 is less than or equal to ARG2 597 ARG1 = ARG2 ARG1 is equal to ARG2 598 ARG1 != ARG2 ARG1 is unequal to ARG2 599 ARG1 >= ARG2 ARG1 is greater than or equal to ARG2 600 ARG1 > ARG2 ARG1 is greater than ARG2 601 ARG1 + ARG2 arithmetic sum of ARG1 and ARG2 602 ARG1 - ARG2 arithmetic difference of ARG1 and ARG2 603 ARG1 * ARG2 arithmetic product of ARG1 and ARG2 604 ARG1 / ARG2 arithmetic quotient of ARG1 divided by ARG2 605 ARG1 % ARG2 arithmetic remainder of ARG1 divided by ARG2 606 STRING : REGEXP anchored pattern match of REGEXP in STRING 607 match STRING REGEXP same as STRING : REGEXP 608 substr STRING POS LENGTH substring of STRING, POS counted from 1 609 index STRING CHARS index in STRING where any CHARS is found, 610 or 0 611 length STRING length of STRING 612 quote TOKEN interpret TOKEN as a string, even if 613 it is a keyword like `match' or an 614 operator like `/' 615 ( EXPRESSION ) value of EXPRESSION 616 617Beware that many operators need to be escaped or quoted for shells. 618Comparisons are arithmetic if both ARGs are numbers, else 619lexicographical. Pattern matches return the string matched between 620\( and \) or null; if \( and \) are not used, they return the number 621of characters matched or 0. 622 623------------------------------- 624 625=item B<false> 626 627false 628 629Return an exit code of FALSE (1). 630 631Example: 632 633 $ false 634 $ echo $? 635 1 636 637------------------------------- 638 639=item B<fbset> 640 641fbset [options] [mode] 642 643Show and modify frame buffer settings 644 645Example: 646 647 $ fbset 648 mode "1024x768-76" 649 # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz 650 geometry 1024 768 1024 768 16 651 timings 12714 128 32 16 4 128 4 652 accel false 653 rgba 5/11,6/5,5/0,0/0 654 endmode 655 656------------------------------- 657 658=item B<fdflush> 659 660fdflush DEVICE 661 662Forces floppy disk drive to detect disk change 663 664------------------------------- 665 666=item B<find> 667 668find [PATH...] [EXPRESSION] 669 670Search for files in a directory hierarchy. The default PATH is 671the current directory; default EXPRESSION is 'B<-print>' 672 673EXPRESSION may consist of: 674 675 -follow Dereference symbolic links. 676 -name PATTERN File name (leading directories removed) matches PATTERN. 677 -print Print (default and assumed). 678 679 -type X Filetype matches X (where X is one of: f,d,l,b,c,...) 680 -perm PERMS Permissions match any of (+NNN); all of (-NNN); 681 or exactly (NNN) 682 -mtime TIME Modified time is greater than (+N); less than (-N); 683 or exactly (N) days 684 685Example: 686 687 $ find / -name /etc/passwd 688 /etc/passwd 689 690------------------------------- 691 692=item B<free> 693 694free 695 696Displays the amount of free and used system memory 697 698Example: 699 700 $ free 701 total used free shared buffers 702 Mem: 257628 248724 8904 59644 93124 703 Swap: 128516 8404 120112 704 Total: 386144 257128 129016 705 706------------------------------- 707 708=item B<freeramdisk> 709 710freeramdisk DEVICE 711 712Frees all memory used by the specified ramdisk. 713 714Example: 715 716 $ freeramdisk /dev/ram2 717 718------------------------------- 719 720=item B<fsck_minix> 721 722fsck_minix [B<-larvsmf>] /dev/name 723 724Performs a consistency check for MINIX filesystems. 725 726Options: 727 728 -l Lists all filenames 729 -r Perform interactive repairs 730 -a Perform automatic repairs 731 -v verbose 732 -s Outputs super-block information 733 -m Activates MINIX-like "mode not cleared" warnings 734 -f Force file system check. 735 736------------------------------- 737 738=item B<getopt> 739 740getopt [OPTIONS]... 741 742Parse command options 743 744 -a, --alternative Allow long options starting with single - 745 -l, --longoptions=longopts Long options to be recognized 746 -n, --name=progname The name under which errors are reported 747 -o, --options=optstring Short options to be recognized 748 -q, --quiet Disable error reporting by getopt(3) 749 -Q, --quiet-output No normal output 750 -s, --shell=shell Set shell quoting conventions 751 -T, --test Test for getopt(1) version 752 -u, --unqote Do not quote the output 753 754Example: 755 756 $ cat getopt.test 757 #!/bin/sh 758 GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \ 759 -n 'example.busybox' -- "$@"` 760 if [ $? != 0 ] ; then exit 1 ; fi 761 eval set -- "$GETOPT" 762 while true ; do 763 case $1 in 764 -a|--a-long) echo "Option a" ; shift ;; 765 -b|--b-long) echo "Option b, argument `$2'" ; shift 2 ;; 766 -c|--c-long) 767 case "$2" in 768 "") echo "Option c, no argument"; shift 2 ;; 769 *) echo "Option c, argument `$2'" ; shift 2 ;; 770 esac ;; 771 --) shift ; break ;; 772 *) echo "Internal error!" ; exit 1 ;; 773 esac 774 done 775 776------------------------------- 777 778=item B<grep> 779 780grep [B<-ihHnqvs>] PATTERN [FILEs...] 781 782Search for PATTERN in each FILE or standard input. 783 784Options: 785 786 -H prefix output lines with filename where match was found 787 -h suppress the prefixing filename on output 788 -i ignore case distinctions 789 -l list names of files that match 790 -n print line number with output lines 791 -q be quiet. Returns 0 if result was found, 1 otherwise 792 -v select non-matching lines 793 -s suppress file open/read error messages 794 795Example: 796 797 $ grep root /etc/passwd 798 root:x:0:0:root:/root:/bin/bash 799 $ grep ^[rR]oo. /etc/passwd 800 root:x:0:0:root:/root:/bin/bash 801 802------------------------------- 803 804=item B<gunzip> 805 806gunzip [OPTION]... FILE 807 808Uncompress FILE (or standard input if FILE is '-'). 809 810Options: 811 812 -c Write output to standard output 813 -t Test compressed file integrity 814 815Example: 816 817 $ ls -la /tmp/BusyBox* 818 -rw-rw-r-- 1 andersen andersen 557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz 819 $ gunzip /tmp/BusyBox-0.43.tar.gz 820 $ ls -la /tmp/BusyBox* 821 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar 822 823------------------------------- 824 825=item B<gzip> 826 827gzip [OPTION]... FILE 828 829Compress FILE with maximum compression. 830When FILE is '-', reads standard input. Implies B<-c>. 831 832Options: 833 834 -c Write output to standard output instead of FILE.gz 835 -d decompress 836 837Example: 838 839 $ ls -la /tmp/busybox* 840 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/busybox.tar 841 $ gzip /tmp/busybox.tar 842 $ ls -la /tmp/busybox* 843 -rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz 844 845------------------------------- 846 847=item B<halt> 848 849halt 850 851Halt the system. 852 853------------------------------- 854 855=item B<head> 856 857head [OPTION] [FILE]... 858 859Print first 10 lines of each FILE to standard output. 860With more than one FILE, precede each with a header giving the 861file name. With no FILE, or when FILE is -, read standard input. 862 863Options: 864 865 -n NUM Print first NUM lines instead of first 10 866 867Example: 868 869 $ head -n 2 /etc/passwd 870 root:x:0:0:root:/root:/bin/bash 871 daemon:x:1:1:daemon:/usr/sbin:/bin/sh 872 873------------------------------- 874 875=item B<hostid> 876 877hostid 878 879Print out a unique 32-bit identifier for the machine. 880 881------------------------------- 882 883=item B<hostname> 884 885hostname [OPTION] {hostname | B<-F> FILE} 886 887Get or set the hostname or DNS domain name. If a hostname is given 888(or FILE with the B<-F> parameter), the host name will be set. 889 890Options: 891 892 -s Short 893 -i Addresses for the hostname 894 -d DNS domain name 895 -F, --file FILE Use the contents of FILE to specify the hostname 896 897Example: 898 899 $ hostname 900 sage 901 902------------------------------- 903 904=item B<id> 905 906id [OPTIONS]... [USERNAME] 907 908Print information for USERNAME or the current user 909 910Options: 911 912 -g prints only the group ID 913 -u prints only the user ID 914 -n print a name instead of a number (with for -ug) 915 -r prints the real user ID instead of the effective ID (with -ug) 916 917Example: 918 919 $ id 920 uid=1000(andersen) gid=1000(andersen) 921 922------------------------------- 923 924=item B<ifconfig> 925 926ifconfig [B<-a>] <interface> [<address>] 927 928configure a network interface 929 930Options: 931 932 [[-]broadcast [<address>]] [[-]pointopoint [<address>]] 933 [netmask <address>] [dstaddr <address>] 934 [outfill <NN>] [keepalive <NN>] 935 [hw ether <address>] [metric <NN>] [mtu <NN>] 936 [[-]trailers] [[-]arp] [[-]allmulti] 937 [multicast] [[-]promisc] [txqueuelen <NN>] [[-]dynamic] 938 [mem_start <NN>] [io_addr <NN>] [irq <NN>] 939 [up|down] ... 940 941------------------------------- 942 943=item B<init> 944 945init 946 947Init is the parent of all processes. 948 949This version of init is designed to be run only by the kernel. 950 951BusyBox init doesn't support multiple runlevels. The runlevels field of 952the /etc/inittab file is completely ignored by BusyBox init. If you want 953runlevels, use sysvinit. 954 955BusyBox init works just fine without an inittab. If no inittab is found, 956it has the following default behavior: 957 958 ::sysinit:/etc/init.d/rcS 959 ::askfirst:/bin/sh 960 ::ctrlaltdel:/sbin/reboot 961 ::shutdown:/sbin/swapoff -a 962 ::shutdown:/bin/umount -a -r 963 964if it detects that /dev/console is _not_ a serial console, it will also run: 965 966 tty2::askfirst:/bin/sh 967 tty3::askfirst:/bin/sh 968 tty4::askfirst:/bin/sh 969 970If you choose to use an /etc/inittab file, the inittab entry format is as follows: 971 972 <id>:<runlevels>:<action>:<process> 973 974 <id>: 975 976 WARNING: This field has a non-traditional meaning for BusyBox init! 977 The id field is used by BusyBox init to specify the controlling tty for 978 the specified process to run on. The contents of this field are 979 appended to "/dev/" and used as-is. There is no need for this field to 980 be unique, although if it isn't you may have strange results. If this 981 field is left blank, the controlling tty is set to the console. Also 982 note that if BusyBox detects that a serial console is in use, then only 983 entries whose controlling tty is either the serial console or /dev/null 984 will be run. BusyBox init does nothing with utmp. We don't need no 985 stinkin' utmp. 986 987 <runlevels>: 988 989 The runlevels field is completely ignored. 990 991 <action>: 992 993 Valid actions include: sysinit, respawn, askfirst, wait, 994 once, ctrlaltdel, and shutdown. 995 996 The available actions can be classified into two groups: actions 997 that are run only once, and actions that are re-run when the specified 998 process exits. 999 1000 Run only-once actions: 1001 1002 'sysinit' is the first item run on boot. init waits until all 1003 sysinit actions are completed before continuing. Following the 1004 completion of all sysinit actions, all 'wait' actions are run. 1005 'wait' actions, like 'sysinit' actions, cause init to wait until 1006 the specified task completes. 'once' actions are asynchronous, 1007 therefore, init does not wait for them to complete. 'ctrlaltdel' 1008 actions are run when the system detects that someone on the system 1009 console has pressed the CTRL-ALT-DEL key combination. Typically one 1010 wants to run 'reboot' at this point to cause the system to reboot. 1011 Finally the 'shutdown' action specifies the actions to taken when 1012 init is told to reboot. Unmounting filesystems and disabling swap 1013 is a very good here 1014 1015 Run repeatedly actions: 1016 1017 'respawn' actions are run after the 'once' actions. When a process 1018 started with a 'respawn' action exits, init automatically restarts 1019 it. Unlike sysvinit, BusyBox init does not stop processes from 1020 respawning out of control. The 'askfirst' actions acts just like 1021 respawn, except that before running the specified process it 1022 displays the line "Please press Enter to activate this console." 1023 and then waits for the user to press enter before starting the 1024 specified process. 1025 1026 Unrecognized actions (like initdefault) will cause init to emit an 1027 error message, and then go along with its business. All actions are 1028 run in the reverse order from how they appear in /etc/inittab. 1029 1030 <process>: 1031 1032 Specifies the process to be executed and it's command line. 1033 1034Example /etc/inittab file: 1035 1036 # This is run first except when booting in single-user mode. 1037 # 1038 ::sysinit:/etc/init.d/rcS 1039 1040 # /bin/sh invocations on selected ttys 1041 # 1042 # Start an "askfirst" shell on the console (whatever that may be) 1043 ::askfirst:-/bin/sh 1044 # Start an "askfirst" shell on /dev/tty2-4 1045 tty2::askfirst:-/bin/sh 1046 tty3::askfirst:-/bin/sh 1047 tty4::askfirst:-/bin/sh 1048 1049 # /sbin/getty invocations for selected ttys 1050 # 1051 tty4::respawn:/sbin/getty 38400 tty5 1052 tty5::respawn:/sbin/getty 38400 tty6 1053 1054 1055 # Example of how to put a getty on a serial line (for a terminal) 1056 # 1057 #::respawn:/sbin/getty -L ttyS0 9600 vt100 1058 #::respawn:/sbin/getty -L ttyS1 9600 vt100 1059 # 1060 # Example how to put a getty on a modem line. 1061 #::respawn:/sbin/getty 57600 ttyS2 1062 1063 # Stuff to do before rebooting 1064 ::ctrlaltdel:/sbin/reboot 1065 ::shutdown:/bin/umount -a -r 1066 ::shutdown:/sbin/swapoff -a 1067 1068 1069------------------------------- 1070 1071=item B<insmod> 1072 1073insmod [OPTION]... MODULE [symbol=value]... 1074 1075Loads the specified kernel modules into the kernel. 1076 1077Options: 1078 1079 -f Force module to load into the wrong kernel version. 1080 -k Make module autoclean-able. 1081 -v verbose output 1082 -L Lock to prevent simultaneous loads of a module 1083 -x do not export externs 1084 1085------------------------------- 1086 1087=item B<kill> 1088 1089kill [B<-signal>] process-id [process-id ...] 1090 1091Send a signal (default is SIGTERM) to the specified process(es). 1092 1093Options: 1094 1095 -l List all signal names and numbers. 1096 1097Example: 1098 1099 $ ps | grep apache 1100 252 root root S [apache] 1101 263 www-data www-data S [apache] 1102 264 www-data www-data S [apache] 1103 265 www-data www-data S [apache] 1104 266 www-data www-data S [apache] 1105 267 www-data www-data S [apache] 1106 $ kill 252 1107 1108------------------------------- 1109 1110=item B<killall> 1111 1112killall [B<-signal>] process-name [process-name ...] 1113 1114Send a signal (default is SIGTERM) to the specified process(es). 1115 1116Options: 1117 1118 -l List all signal names and numbers. 1119 1120Example: 1121 1122 $ killall apache 1123 1124------------------------------- 1125 1126=item B<klogd> 1127 1128klogd B<-n> 1129 1130Kernel logger. 1131Options: 1132 1133 -n Run as a foreground process. 1134 1135------------------------------- 1136 1137=item B<ktab> 1138 1139ktab [B<-fpr> FILE] 1140 1141Run a specified program every X amount of seconds 1142Options: 1143 1144 -f Script for KTAB 1145 -p File to run (takes defaults) 1146 -r Review Script, report all errors 1147 1148------------------------------- 1149 1150=item B<lash> 1151 1152lash [FILE]... 1153or: sh B<-c> command [args]... 1154 1155lash: The BusyBox LAme SHell (command interpreter) 1156 1157This command does not yet have proper documentation. 1158 1159Use lash just as you would use any other shell. It properly handles pipes, 1160redirects, job control, can be used as the shell for scripts, and has a 1161sufficient set of builtins to do what is needed. It does not (yet) support 1162Bourne Shell syntax. If you need things like "if-then-else", "while", and such 1163use ash or bash. If you just need a very simple and extremely small shell, 1164this will do the job. 1165 1166------------------------------- 1167 1168=item B<length> 1169 1170length STRING 1171 1172Prints out the length of the specified STRING. 1173 1174Example: 1175 1176 $ length Hello 1177 5 1178 1179------------------------------- 1180 1181=item B<ln> 1182 1183ln [OPTION] TARGET... LINK_NAME|DIRECTORY 1184 1185Create a link named LINK_NAME or DIRECTORY to the specified TARGET 1186 1187You may use '--' to indicate that all following arguments are non-options. 1188 1189Options: 1190 1191 -s make symbolic links instead of hard links 1192 -f remove existing destination files 1193 -n no dereference symlinks - treat like normal file 1194 1195Example: 1196 1197 $ ln -s BusyBox /tmp/ls 1198 $ ls -l /tmp/ls 1199 lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -> BusyBox* 1200 1201------------------------------- 1202 1203=item B<loadacm> 1204 1205loadacm < mapfile 1206 1207Loads an acm from standard input. 1208 1209Example: 1210 1211 $ loadacm < /etc/i18n/acmname 1212 1213------------------------------- 1214 1215=item B<loadfont> 1216 1217loadfont < font 1218 1219Loads a console font from standard input. 1220 1221Example: 1222 1223 $ loadfont < /etc/i18n/fontname 1224 1225------------------------------- 1226 1227=item B<loadkmap> 1228 1229loadkmap < keymap 1230 1231Loads a binary keyboard translation table from standard input. 1232 1233Example: 1234 1235 $ loadkmap < /etc/i18n/lang-keymap 1236 1237------------------------------- 1238 1239=item B<logger> 1240 1241logger [OPTION]... [MESSAGE] 1242 1243Write MESSAGE to the system log. If MESSAGE is omitted, log stdin. 1244 1245Options: 1246 1247 -s Log to stderr as well as the system log. 1248 -t Log using the specified tag (defaults to user name). 1249 -p Enter the message with the specified priority. 1250 This may be numerical or a ``facility.level'' pair. 1251 1252Example: 1253 1254 $ logger "hello" 1255 1256------------------------------- 1257 1258=item B<logname> 1259 1260logname 1261 1262Print the name of the current user. 1263 1264Example: 1265 1266 $ logname 1267 root 1268 1269------------------------------- 1270 1271=item B<logread> 1272 1273logread 1274 1275Shows the messages from syslogd (using circular buffer). 1276 1277------------------------------- 1278 1279=item B<ls> 1280 1281ls [B<-1AacCdeFilnpLRrSsTtuvwxXhk>] [filenames...] 1282 1283List directory contents 1284 1285Options: 1286 1287 -1 list files in a single column 1288 -A do not list implied . and .. 1289 -a do not hide entries starting with . 1290 -C list entries by columns 1291 -c with -l: show ctime 1292 -d list directory entries instead of contents 1293 -e list both full date and full time 1294 -F append indicator (one of */=@|) to entries 1295 -i list the i-node for each file 1296 -l use a long listing format 1297 -n list numeric UIDs and GIDs instead of names 1298 -p append indicator (one of /=@|) to entries 1299 -L list entries pointed to by symbolic links 1300 -R list subdirectories recursively 1301 -r sort the listing in reverse order 1302 -S sort the listing by file size 1303 -s list the size of each file, in blocks 1304 -T NUM assume Tabstop every NUM columns 1305 -t with -l: show modification time 1306 -u with -l: show access time 1307 -v sort the listing by version 1308 -w NUM assume the terminal is NUM columns wide 1309 -x list entries by lines instead of by columns 1310 -X sort the listing by extension 1311 -h print sizes in human readable format (e.g., 1K 243M 2G ) 1312 -k print sizes in kilobytes(default) 1313 1314------------------------------- 1315 1316=item B<lsmod> 1317 1318lsmod 1319 1320List the currently loaded kernel modules. 1321 1322------------------------------- 1323 1324=item B<makedevs> 1325 1326makedevs NAME TYPE MAJOR MINOR FIRST LAST [s] 1327 1328Creates a range of block or character special files 1329 1330TYPEs include: 1331 1332 b: Make a block (buffered) device. 1333 c or u: Make a character (un-buffered) device. 1334 p: Make a named pipe. MAJOR and MINOR are ignored for named pipes. 1335 1336FIRST specifies the number appended to NAME to create the first device. 1337LAST specifies the number of the last item that should be created. 1338If 's' is the last argument, the base device is created as well. 1339 1340For example: 1341 1342 makedevs /dev/ttyS c 4 66 2 63 -> ttyS2-ttyS63 1343 makedevs /dev/hda b 3 0 0 8 s -> hda,hda1-hda8 1344 1345Example: 1346 1347 $ makedevs /dev/ttyS c 4 66 2 63 1348 [creates ttyS2-ttyS63] 1349 $ makedevs /dev/hda b 3 0 0 8 s 1350 [creates hda,hda1-hda8] 1351 1352------------------------------- 1353 1354=item B<md5sum> 1355 1356md5sum [OPTION] [FILE]... 1357or: md5sum [OPTION] B<-c> [FILE] 1358 1359Print or check MD5 checksums. 1360 1361Options: 1362With no FILE, or when FILE is -, read standard input. 1363 1364 -b read files in binary mode 1365 -c check MD5 sums against given list 1366 -t read files in text mode (default) 1367 -g read a string 1368 1369The following two options are useful only when verifying checksums: 1370 1371 -s don't output anything, status code shows success 1372 -w warn about improperly formated MD5 checksum lines 1373 1374Example: 1375 1376 $ md5sum < busybox 1377 6fd11e98b98a58f64ff3398d7b324003 1378 $ md5sum busybox 1379 6fd11e98b98a58f64ff3398d7b324003 busybox 1380 $ md5sum -c - 1381 6fd11e98b98a58f64ff3398d7b324003 busybox 1382 busybox: OK 1383 ^D 1384 1385------------------------------- 1386 1387=item B<mkdir> 1388 1389mkdir [OPTION] DIRECTORY... 1390 1391Create the DIRECTORY(ies) if they do not already exist 1392 1393Options: 1394 1395 -m set permission mode (as in chmod), not rwxrwxrwx - umask 1396 -p no error if existing, make parent directories as needed 1397 1398Example: 1399 1400 $ mkdir /tmp/foo 1401 $ mkdir /tmp/foo 1402 /tmp/foo: File exists 1403 $ mkdir /tmp/foo/bar/baz 1404 /tmp/foo/bar/baz: No such file or directory 1405 $ mkdir -p /tmp/foo/bar/baz 1406 1407------------------------------- 1408 1409=item B<mkfifo> 1410 1411mkfifo [OPTIONS] name 1412 1413Creates a named pipe (identical to 'mknod name p') 1414 1415Options: 1416 1417 -m create the pipe using the specified mode (default a=rw) 1418 1419------------------------------- 1420 1421=item B<mkfs_minix> 1422 1423mkfs_minix [B<-c> | B<-l> filename] [B<-nXX>] [B<-iXX>] /dev/name [blocks] 1424 1425Make a MINIX filesystem. 1426 1427Options: 1428 1429 -c Check the device for bad blocks 1430 -n [14|30] Specify the maximum length of filenames 1431 -i INODES Specify the number of inodes for the filesystem 1432 -l FILENAME Read the bad blocks list from FILENAME 1433 -v Make a Minix version 2 filesystem 1434 1435------------------------------- 1436 1437=item B<mknod> 1438 1439mknod [OPTIONS] NAME TYPE MAJOR MINOR 1440 1441Create a special file (block, character, or pipe). 1442 1443Options: 1444 1445 -m create the special file using the specified mode (default a=rw) 1446 1447TYPEs include: 1448 1449 b: Make a block (buffered) device. 1450 c or u: Make a character (un-buffered) device. 1451 p: Make a named pipe. MAJOR and MINOR are ignored for named pipes. 1452 1453Example: 1454 1455 $ mknod /dev/fd0 b 2 0 1456 $ mknod -m 644 /tmp/pipe p 1457 1458------------------------------- 1459 1460=item B<mkswap> 1461 1462mkswap [B<-c>] [B<-v0>|B<-v1>] device [block-count] 1463 1464Prepare a disk partition to be used as a swap partition. 1465 1466Options: 1467 1468 -c Check for read-ability. 1469 -v0 Make version 0 swap [max 128 Megs]. 1470 -v1 Make version 1 swap [big!] (default for kernels > 1471 2.1.117). 1472 block-count Number of block to use (default is entire partition). 1473 1474------------------------------- 1475 1476=item B<mktemp> 1477 1478mktemp [B<-q>] TEMPLATE 1479 1480Creates a temporary file with its name based on TEMPLATE. 1481TEMPLATE is any name with six `Xs' (i.e., /tmp/temp.XXXXXX). 1482 1483Example: 1484 1485 $ mktemp /tmp/temp.XXXXXX 1486 /tmp/temp.mWiLjM 1487 $ ls -la /tmp/temp.mWiLjM 1488 -rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM 1489 1490------------------------------- 1491 1492=item B<modprobe> 1493 1494modprobe [FILE ...] 1495 1496Used for hight level module loading and unloading. 1497 1498Example: 1499 1500 $ modprobe cdrom 1501 1502------------------------------- 1503 1504=item B<more> 1505 1506more [FILE ...] 1507 1508More is a filter for viewing FILE one screenful at a time. 1509 1510Example: 1511 1512 $ dmesg | more 1513 1514------------------------------- 1515 1516=item B<mount> 1517 1518mount [flags] DEVICE NODE [B<-o> options,more-options] 1519 1520Mount a filesystem 1521 1522Flags: 1523 1524 -a: Mount all filesystems in fstab. 1525 -f: "Fake" Add entry to mount table but don't mount it. 1526 -n: Don't write a mount table entry. 1527 -o option: One of many filesystem options, listed below. 1528 -r: Mount the filesystem read-only. 1529 -t fs-type: Specify the filesystem type. 1530 -w: Mount for reading and writing (default). 1531 1532Options for use with the "B<-o>" flag: 1533 1534 async/sync: Writes are asynchronous / synchronous. 1535 atime/noatime: Enable / disable updates to inode access times. 1536 dev/nodev: Allow use of special device files / disallow them. 1537 exec/noexec: Allow use of executable files / disallow them. 1538 loop: Mounts a file via loop device. 1539 suid/nosuid: Allow set-user-id-root programs / disallow them. 1540 remount: Re-mount a mounted filesystem, changing its flags. 1541 ro/rw: Mount for read-only / read-write. 1542 bind: Use the linux 2.4.x "bind" feature. 1543 1544There are EVEN MORE flags that are specific to each filesystem. 1545You'll have to see the written documentation for those filesystems. 1546 1547Example: 1548 1549 $ mount 1550 /dev/hda3 on / type minix (rw) 1551 proc on /proc type proc (rw) 1552 devpts on /dev/pts type devpts (rw) 1553 $ mount /dev/fd0 /mnt -t msdos -o ro 1554 $ mount /tmp/diskimage /opt -t ext2 -o loop 1555 1556------------------------------- 1557 1558=item B<mt> 1559 1560mt [B<-f> device] opcode value 1561 1562Control magnetic tape drive operation 1563 1564Available Opcodes: 1565 1566bsf bsfm bsr bss datacompression drvbuffer eof eom erase 1567fsf fsfm fsr fss load lock mkpart nop offline ras1 ras2 1568ras3 reset retension rew rewoffline seek setblk setdensity 1569setpart tell unload unlock weof wset 1570 1571------------------------------- 1572 1573=item B<mv> 1574 1575mv SOURCE DEST 1576or: mv SOURCE... DIRECTORY 1577 1578Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY. 1579 1580Example: 1581 1582 $ mv /tmp/foo /bin/bar 1583 1584------------------------------- 1585 1586=item B<nc> 1587 1588nc [IP] [port] 1589 1590Netcat opens a pipe to IP:port 1591 1592Example: 1593 1594 $ nc foobar.somedomain.com 25 1595 220 foobar ESMTP Exim 3.12 #1 Sat, 15 Apr 2000 00:03:02 -0600 1596 help 1597 214-Commands supported: 1598 214- HELO EHLO MAIL RCPT DATA AUTH 1599 214 NOOP QUIT RSET HELP 1600 quit 1601 221 foobar closing connection 1602 1603------------------------------- 1604 1605=item B<nslookup> 1606 1607nslookup [HOST] [SERVER] 1608 1609Queries the nameserver for the IP address of the given HOST 1610optionally using a specified DNS server 1611 1612Example: 1613 1614 $ nslookup localhost 1615 Server: default 1616 Address: default 1617 1618 Name: debian 1619 Address: 127.0.0.1 1620 1621------------------------------- 1622 1623=item B<pidof> 1624 1625pidof process-name [process-name ...] 1626 1627Lists the PIDs of all processes with names that match the names on the command line 1628 1629Example: 1630 1631 $ pidof init 1632 1 1633 1634------------------------------- 1635 1636=item B<ping> 1637 1638ping [OPTION]... host 1639 1640Send ICMP ECHO_REQUEST packets to network hosts. 1641 1642Options: 1643 1644 -c COUNT Send only COUNT pings. 1645 -s SIZE Send SIZE data bytes in packets (default=56). 1646 -q Quiet mode, only displays output at start 1647 and when finished. 1648 1649Example: 1650 1651 $ ping localhost 1652 PING slag (127.0.0.1): 56 data bytes 1653 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=20.1 ms 1654 1655 --- debian ping statistics --- 1656 1 packets transmitted, 1 packets received, 0% packet loss 1657 round-trip min/avg/max = 20.1/20.1/20.1 ms 1658 1659------------------------------- 1660 1661=item B<pivot_root> 1662 1663pivot_root NEW_ROOT PUT_OLD 1664 1665Move the current root file system to PUT_OLD and make NEW_ROOT 1666the new root file system. 1667 1668------------------------------- 1669 1670=item B<poweroff> 1671 1672poweroff 1673 1674Halt the system and request that the kernel shut off the power. 1675 1676------------------------------- 1677 1678=item B<printf> 1679 1680printf FORMAT [ARGUMENT...] 1681 1682Formats and prints ARGUMENT(s) according to FORMAT, 1683Where FORMAT controls the output exactly as in C printf. 1684 1685Example: 1686 1687 $ printf "Val=%d\n" 5 1688 Val=5 1689 1690------------------------------- 1691 1692=item B<ps> 1693 1694ps 1695 1696Report process status 1697 1698This version of ps accepts no options. 1699 1700Example: 1701 1702 $ ps 1703 PID Uid Gid State Command 1704 1 root root S init 1705 2 root root S [kflushd] 1706 3 root root S [kupdate] 1707 4 root root S [kpiod] 1708 5 root root S [kswapd] 1709 742 andersen andersen S [bash] 1710 743 andersen andersen S -bash 1711 745 root root S [getty] 1712 2990 andersen andersen R ps 1713 1714------------------------------- 1715 1716=item B<pwd> 1717 1718pwd 1719 1720Print the full filename of the current working directory. 1721 1722Example: 1723 1724 $ pwd 1725 /root 1726 1727------------------------------- 1728 1729=item B<rdate> 1730 1731rdate [OPTION] HOST 1732 1733Get and possibly set the system date and time from a remote HOST. 1734 1735Options: 1736 1737 -s Set the system date and time (default). 1738 -p Print the date and time. 1739 1740------------------------------- 1741 1742=item B<readlink> 1743 1744readlink 1745 1746Read a symbolic link. 1747 1748------------------------------- 1749 1750=item B<reboot> 1751 1752reboot 1753 1754Reboot the system. 1755 1756------------------------------- 1757 1758=item B<renice> 1759 1760renice priority pid [pid ...] 1761 1762Changes priority of running processes. Allowed priorities range 1763from 20 (the process runs only when nothing else is running) to 0 1764(default priority) to B<-20> (almost nothing else ever gets to run). 1765 1766------------------------------- 1767 1768=item B<reset> 1769 1770reset 1771 1772Resets the screen. 1773 1774------------------------------- 1775 1776=item B<rm> 1777 1778rm [OPTION]... FILE... 1779 1780Remove (unlink) the FILE(s). You may use '--' to 1781indicate that all following arguments are non-options. 1782 1783Options: 1784 1785 -i always prompt before removing each destination -f remove existing destinations, never prompt 1786 -r or -R remove the contents of directories recursively 1787 1788Example: 1789 1790 $ rm -rf /tmp/foo 1791 1792------------------------------- 1793 1794=item B<rmdir> 1795 1796rmdir [OPTION]... DIRECTORY... 1797 1798Remove the DIRECTORY(ies), if they are empty. 1799 1800Example: 1801 1802 # rmdir /tmp/foo 1803 1804------------------------------- 1805 1806=item B<rmmod> 1807 1808rmmod [OPTION]... [MODULE]... 1809 1810Unloads the specified kernel modules from the kernel. 1811 1812Options: 1813 1814 -a Try to remove all unused kernel modules. 1815 1816Example: 1817 1818 $ rmmod tulip 1819 1820------------------------------- 1821 1822=item B<route> 1823 1824route [{add|del|flush}] 1825 1826Edit the kernel's routing tables 1827 1828------------------------------- 1829 1830=item B<rpm2cpio> 1831 1832rpm2cpio package.rpm 1833 1834Outputs a cpio archive of the rpm file. 1835 1836------------------------------- 1837 1838=item B<rpmunpack> 1839 1840rpmunpack < package.rpm | gunzip | cpio B<-idmuv> 1841 1842Extracts an rpm archive. 1843 1844------------------------------- 1845 1846=item B<sed> 1847 1848sed [B<-nef>] pattern [files...] 1849 1850Options: 1851 1852 -n suppress automatic printing of pattern space 1853 -e script add the script to the commands to be executed 1854 -f scriptfile add the contents of script-file to the commands to be executed 1855 1856If no B<-e> or B<-f> is given, the first non-option argument is taken as the 1857sed script to interpret. All remaining arguments are names of input 1858files; if no input files are specified, then the standard input is read. 1859 1860Example: 1861 1862 $ echo "foo" | sed -e 's/f[a-zA-Z]o/bar/g' 1863 bar 1864 1865------------------------------- 1866 1867=item B<setkeycodes> 1868 1869setkeycodes SCANCODE KEYCODE ... 1870 1871Set entries into the kernel's scancode-to-keycode map, 1872allowing unusual keyboards to generate usable keycodes. 1873 1874SCANCODE may be either xx or e0xx (hexadecimal), 1875and KEYCODE is given in decimal 1876 1877Example: 1878 1879 $ setkeycodes e030 127 1880 1881------------------------------- 1882 1883=item B<sleep> 1884 1885sleep N 1886 1887Pause for N seconds. 1888 1889Example: 1890 1891 $ sleep 2 1892 [2 second delay results] 1893 1894------------------------------- 1895 1896=item B<sort> 1897 1898sort [B<-nru>] [FILE]... 1899 1900Sorts lines of text in the specified files 1901 1902Options: 1903 1904 -u suppress duplicate lines 1905 -r sort in reverse order 1906 -n sort numerics 1907 1908Example: 1909 1910 $ echo -e "e\nf\nb\nd\nc\na" | sort 1911 a 1912 b 1913 c 1914 d 1915 e 1916 f 1917 1918------------------------------- 1919 1920=item B<stty> 1921 1922stty [B<-a>|g] [B<-F> DEVICE] [SETTING]... 1923 1924Without arguments, prints baud rate, line discipline, 1925and deviations from stty sane. 1926 1927Options: 1928 1929 -F DEVICE open device instead of stdin 1930 -a print all current settings in human-readable form 1931 -g print in stty-readable form 1932 [SETTING] see manpage 1933 1934------------------------------- 1935 1936=item B<swapoff> 1937 1938swapoff [OPTION] [DEVICE] 1939 1940Stop swapping virtual memory pages on DEVICE. 1941 1942Options: 1943 1944 -a Stop swapping on all swap devices 1945 1946------------------------------- 1947 1948=item B<swapon> 1949 1950swapon [OPTION] [DEVICE] 1951 1952Start swapping virtual memory pages on DEVICE. 1953 1954Options: 1955 1956 -a Start swapping on all swap devices 1957 1958------------------------------- 1959 1960=item B<sync> 1961 1962sync 1963 1964Write all buffered filesystem blocks to disk. 1965 1966------------------------------- 1967 1968=item B<syslogd> 1969 1970syslogd [OPTION]... 1971 1972Linux system and kernel logging utility. 1973Note that this version of syslogd ignores /etc/syslog.conf. 1974 1975Options: 1976 1977 -m NUM Interval between MARK lines (default=20min, 0=off) 1978 -n Run as a foreground process 1979 -O FILE Use an alternate log file (default=/var/log/messages) 1980 -R HOST[:PORT] Log to IP or hostname on PORT (default PORT=514/UDP) 1981 1982 -F f Use facility LOCAL<f> (0-7) when sending to remote host. -R must be specified also. 1983 -L Log locally and via network logging (default is network only) 1984 1985Example: 1986 1987 $ syslogd -R masterlog:514 1988 $ syslogd -R 192.168.1.1:601 1989 1990------------------------------- 1991 1992=item B<tail> 1993 1994tail [OPTION]... [FILE]... 1995 1996Print last 10 lines of each FILE to standard output. 1997With more than one FILE, precede each with a header giving the 1998file name. With no FILE, or when FILE is -, read standard input. 1999 2000Options: 2001 2002 -c N[kbm] output the last N bytes 2003 -n N[kbm] print last N lines instead of last 10 2004 -f output data as the file grows 2005 -q never output headers giving file names 2006 -s SEC wait SEC seconds between reads with -f 2007 -v always output headers giving file names 2008 2009If the first character of N (bytes or lines) is a '+', output begins with 2010the Nth item from the start of each file, otherwise, print the last N items 2011in the file. N bytes may be suffixed by k (x1024), b (x512), or m (1024^2). 2012 2013Example: 2014 2015 $ tail -n 1 /etc/resolv.conf 2016 nameserver 10.0.0.1 2017 2018------------------------------- 2019 2020=item B<tar> 2021 2022tar -[cxtvO] [-B<-exclude> FILE] [B<-X> FILE][B<-f> TARFILE] [B<-C> DIR] [FILE(s)] ... 2023 2024Create, extract, or list files from a tar file. 2025 2026Options: 2027 2028 c create 2029 x extract 2030 t list 2031 2032File selection: 2033 2034 f name of TARFILE or "-" for stdin 2035 O extract to stdout 2036 exclude file to exclude 2037 X file with names to exclude 2038 C change to directory DIR before operation 2039 v verbosely list files processed 2040 2041Example: 2042 2043 $ zcat /tmp/tarball.tar.gz | tar -xf - 2044 $ tar -cf /tmp/tarball.tar /usr/local 2045 2046------------------------------- 2047 2048=item B<tee> 2049 2050tee [OPTION]... [FILE]... 2051 2052Copy standard input to each FILE, and also to standard output. 2053 2054Options: 2055 2056 -a append to the given FILEs, do not overwrite 2057 2058Example: 2059 2060 $ echo "Hello" | tee /tmp/foo 2061 $ cat /tmp/foo 2062 Hello 2063 2064------------------------------- 2065 2066=item B<telnet> 2067 2068telnet HOST [PORT] 2069 2070Telnet is used to establish interactive communication with another 2071computer over a network using the TELNET protocol. 2072 2073------------------------------- 2074 2075=item B<test> 2076 2077test EXPRESSION 2078 or [ EXPRESSION ] 2079 2080Checks file types and compares values returning an exit 2081code determined by the value of EXPRESSION. 2082 2083Example: 2084 2085 $ test 1 -eq 2 2086 $ echo $? 2087 1 2088 $ test 1 -eq 1 2089 $ echo $? 2090 0 2091 $ [ -d /etc ] 2092 $ echo $? 2093 0 2094 $ [ -d /junk ] 2095 $ echo $? 2096 1 2097 2098------------------------------- 2099 2100=item B<tftp> 2101 2102tftp command SOURCE DEST 2103 2104Transfers a file from/to a tftp server using "octet" mode. 2105 2106Commands: 2107 2108 get Get file from server SOURCE and store to local DEST. 2109 put Put local file SOURCE to server DEST. 2110 2111When naming a server, use the syntax "server:file". 2112 2113------------------------------- 2114 2115=item B<touch> 2116 2117touch [B<-c>] FILE [FILE ...] 2118 2119Update the last-modified date on the given FILE[s]. 2120 2121Options: 2122 2123 -c Do not create any files 2124 2125Example: 2126 2127 $ ls -l /tmp/foo 2128 /bin/ls: /tmp/foo: No such file or directory 2129 $ touch /tmp/foo 2130 $ ls -l /tmp/foo 2131 -rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo 2132 2133------------------------------- 2134 2135=item B<tr> 2136 2137tr [B<-cds>] STRING1 [STRING2] 2138 2139Translate, squeeze, and/or delete characters from 2140standard input, writing to standard output. 2141 2142Options: 2143 2144 -c take complement of STRING1 2145 -d delete input characters coded STRING1 2146 -s squeeze multiple output characters of STRING2 into one character 2147 2148Example: 2149 2150 $ echo "gdkkn vnqkc" | tr [a-y] [b-z] 2151 hello world 2152 2153------------------------------- 2154 2155=item B<traceroute> 2156 2157traceroute [B<-dnrv>] [B<-m> max_ttl] [B<-p> port#] [B<-q> nqueries] 2158 [B<-s> src_addr] [B<-t> tos] [B<-w> wait] host [data size] 2159 2160trace the route ip packets follow going to "host" 2161Options: 2162 2163 -d set SO_DEBUG options to socket 2164 -n Print hop addresses numerically rather than symbolically 2165 -r Bypass the normal routing tables and send directly to a host 2166 -v Verbose output 2167 -m max_ttl Set the max time-to-live (max number of hops) 2168 -p port# Set the base UDP port number used in probes 2169 (default is 33434) 2170 -q nqueries Set the number of probes per ``ttl'' to nqueries 2171 (default is 3) 2172 -s src_addr Use the following IP address as the source address 2173 -t tos Set the type-of-service in probe packets to the following value 2174 (default 0) 2175 -w wait Set the time (in seconds) to wait for a response to a probe 2176 (default 3 sec.). 2177 2178------------------------------- 2179 2180=item B<true> 2181 2182true 2183 2184Return an exit code of TRUE (0). 2185 2186Example: 2187 2188 $ true 2189 $ echo $? 2190 0 2191 2192------------------------------- 2193 2194=item B<tty> 2195 2196tty 2197 2198Print the file name of the terminal connected to standard input. 2199 2200Options: 2201 2202 -s print nothing, only return an exit status 2203 2204Example: 2205 2206 $ tty 2207 /dev/tty2 2208 2209------------------------------- 2210 2211=item B<umount> 2212 2213umount [flags] FILESYSTEM|DIRECTORY 2214 2215Unmount file systems 2216 2217Flags: 2218 2219 -a Unmount all file systems in /etc/mtab 2220 -n Don't erase /etc/mtab entries 2221 -r Try to remount devices as read-only if mount is busy 2222 -f Force umount (i.e., unreachable NFS server) 2223 -l Do not free loop device (if a loop device has been used) 2224 2225Example: 2226 2227 $ umount /dev/hdc1 2228 2229------------------------------- 2230 2231=item B<uname> 2232 2233uname [OPTION]... 2234 2235Print certain system information. With no OPTION, same as B<-s>. 2236 2237Options: 2238 2239 -a print all information 2240 -m the machine (hardware) type 2241 -n print the machine's network node hostname 2242 -r print the operating system release 2243 -s print the operating system name 2244 -p print the host processor type 2245 -v print the operating system version 2246 2247Example: 2248 2249 $ uname -a 2250 Linux debian 2.2.15pre13 #5 Tue Mar 14 16:03:50 MST 2000 i686 unknown 2251 2252------------------------------- 2253 2254=item B<uniq> 2255 2256uniq [OPTION]... [INPUT [OUTPUT]] 2257 2258Discard all but one of successive identical lines from INPUT 2259(or standard input), writing to OUTPUT (or standard output). 2260 2261Options: 2262 2263 -c prefix lines by the number of occurrences 2264 -d only print duplicate lines 2265 -u only print unique lines 2266 2267Example: 2268 2269 $ echo -e "a\na\nb\nc\nc\na" | sort | uniq 2270 a 2271 b 2272 c 2273 2274------------------------------- 2275 2276=item B<unix2dos> 2277 2278unix2dos [option] [FILE] 2279 2280Converts FILE from unix format to dos format. When no option 2281is given, the input is converted to the opposite output format. 2282When no file is given, uses stdin for input and stdout for output. 2283Options: 2284 2285 -u output will be in UNIX format 2286 -d output will be in DOS format 2287 2288------------------------------- 2289 2290=item B<update> 2291 2292update [options] 2293 2294Periodically flushes filesystem buffers. 2295 2296Options: 2297 2298 -S force use of sync(2) instead of flushing 2299 -s SECS call sync this often (default 30) 2300 -f SECS flush some buffers this often (default 5) 2301 2302------------------------------- 2303 2304=item B<uptime> 2305 2306uptime 2307 2308Display the time since the last boot. 2309 2310Example: 2311 2312 $ uptime 2313 1:55pm up 2:30, load average: 0.09, 0.04, 0.00 2314 2315------------------------------- 2316 2317=item B<usleep> 2318 2319usleep N 2320 2321Pause for N microseconds. 2322 2323Example: 2324 2325 $ usleep 1000000 2326 [pauses for 1 second] 2327 2328------------------------------- 2329 2330=item B<uudecode> 2331 2332uudecode [FILE]... 2333 2334Uudecode a file that is uuencoded. 2335 2336Options: 2337 2338 -o FILE direct output to FILE 2339 2340Example: 2341 2342 $ uudecode -o busybox busybox.uu 2343 $ ls -l busybox 2344 -rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox 2345 2346------------------------------- 2347 2348=item B<uuencode> 2349 2350uuencode [OPTION] [INFILE] REMOTEFILE 2351 2352Uuencode a file. 2353 2354Options: 2355 2356 -m use base64 encoding per RFC1521 2357 2358Example: 2359 2360 $ uuencode busybox busybox 2361 begin 755 busybox 2362 <encoded file snipped> 2363 $ uudecode busybox busybox > busybox.uu 2364 $ 2365 2366------------------------------- 2367 2368=item B<vi> 2369 2370vi [OPTION] [FILE]... 2371 2372edit FILE. 2373 2374Options: 2375 2376 -R Read-only- do not write to the file. 2377 2378------------------------------- 2379 2380=item B<watchdog> 2381 2382watchdog DEV 2383 2384Periodically write to watchdog device DEV 2385 2386------------------------------- 2387 2388=item B<wc> 2389 2390wc [OPTION]... [FILE]... 2391 2392Print line, word, and byte counts for each FILE, and a total line if 2393more than one FILE is specified. With no FILE, read standard input. 2394 2395Options: 2396 2397 -c print the byte counts 2398 -l print the newline counts 2399 -L print the length of the longest line 2400 -w print the word counts 2401 2402Example: 2403 2404 $ wc /etc/passwd 2405 31 46 1365 /etc/passwd 2406 2407------------------------------- 2408 2409=item B<wget> 2410 2411wget [B<-c>|-B<-continue>] [B<-q>|-B<-quiet>] [B<-O>|-B<-output>-document file] 2412 [-B<-header> 'header: value'] [B<-P> DIR] url 2413 2414wget retrieves files via HTTP or FTP 2415 2416Options: 2417 2418 -c continue retrieval of aborted transfers 2419 -q quiet mode - do not print 2420 -P Set directory prefix to DIR 2421 -O save to filename ('-' for stdout) 2422 2423------------------------------- 2424 2425=item B<which> 2426 2427which [COMMAND ...] 2428 2429Locates a COMMAND. 2430 2431Example: 2432 2433 $ which login 2434 /bin/login 2435 2436------------------------------- 2437 2438=item B<whoami> 2439 2440whoami 2441 2442Prints the user name associated with the current effective user id. 2443 2444------------------------------- 2445 2446=item B<xargs> 2447 2448xargs [COMMAND] [ARGS...] 2449 2450Executes COMMAND on every item given by standard input. 2451 2452Example: 2453 2454 $ ls | xargs gzip 2455 $ find . -name '*.c' -print | xargs rm 2456 2457------------------------------- 2458 2459=item B<yes> 2460 2461yes [OPTION]... [STRING]... 2462 2463Repeatedly outputs a line with all specified STRING(s), or 'y'. 2464 2465------------------------------- 2466 2467=item B<zcat> 2468 2469zcat FILE 2470 2471Uncompress to stdout. 2472 2473------------------------------- 2474 2475=back 2476 2477=head1 LIBC NSS 2478 2479GNU Libc uses the Name Service Switch (NSS) to configure the behavior of the C 2480library for the local environment, and to configure how it reads system data, 2481such as passwords and group information. BusyBox has made it Policy that it 2482will never use NSS, and will never use and libc calls that make use of NSS. 2483This allows you to run an embedded system without the need for installing an 2484/etc/nsswitch.conf file and without and /lib/libnss_* libraries installed. 2485 2486If you are using a system that is using a remote LDAP server for authentication 2487via GNU libc NSS, and you want to use BusyBox, then you will need to adjust the 2488BusyBox source. Chances are though, that if you have enough space to install 2489of that stuff on your system, then you probably want the full GNU utilities. 2490 2491=head1 SEE ALSO 2492 2493textutils(1), shellutils(1), etc... 2494 2495=head1 MAINTAINER 2496 2497Erik Andersen <andersee@debian.org> <andersen@lineo.com> 2498 2499=head1 AUTHORS 2500 2501The following people have contributed code to BusyBox whether 2502they know it or not. 2503 2504 2505=for html <br> 2506 2507Erik Andersen <andersen@lineo.com>, <andersee@debian.org> 2508 2509 Tons of new stuff, major rewrite of most of the 2510 core apps, tons of new apps as noted in header files. 2511 2512=for html <br> 2513 2514John Beppu <beppu@lineo.com> 2515 2516 du, head, nslookup, sort, tee, uniq (so Kraai could rewrite them ;-), 2517 documentation 2518 2519=for html <br> 2520 2521Edward Betts <edward@debian.org> 2522 2523 expr, hostid, logname, tty, wc, whoami, yes 2524 2525=for html <br> 2526 2527Brian Candler <B.Candler@pobox.com> 2528 2529 tiny-ls(ls) 2530 2531=for html <br> 2532 2533Randolph Chung <tausq@debian.org> 2534 2535 fbset, ping, hostname, and mkfifo 2536 2537=for html <br> 2538 2539Dave Cinege <dcinege@psychosis.com> 2540 2541 more(v2), makedevs, dutmp, modularization, auto links file, 2542 various fixes, Linux Router Project maintenance 2543 2544=for html <br> 2545 2546Larry Doolittle <ldoolitt@recycle.lbl.gov> 2547 2548 various fixes, shell rewrite 2549 2550=for html <br> 2551 2552Karl M. Hegbloom <karlheg@debian.org> 2553 2554 cp_mv.c, the test suite, various fixes to utility.c, &c. 2555 2556=for html <br> 2557 2558Sterling Huxley <sterling@europa.com> 2559 2560 vi (!!!) 2561 2562=for html <br> 2563 2564Daniel Jacobowitz <dan@debian.org> 2565 2566 mktemp.c 2567 2568=for html <br> 2569 2570Matt Kraai <kraai@alumni.carnegiemellon.edu> 2571 2572 documentation, bugfixes 2573 2574=for html <br> 2575 2576John Lombardo <john@deltanet.com> 2577 2578 dirname, tr 2579 2580=for html <br> 2581 2582Glenn McGrath <bug1@netconnect.com.au> 2583 2584 ar.c 2585 2586=for html <br> 2587 2588Vladimir Oleynik <dzo@simtreas.ru> 2589 2590 cmdedit, stty-port, locale, various fixes 2591 and irreconcilable critic of everything not perfect. 2592 2593=for html <br> 2594 2595Bruce Perens <bruce@pixar.com> 2596 2597 Original author of BusyBox. His code is still in many apps. 2598 2599=for html <br> 2600 2601Chip Rosenthal <chip@unicom.com>, <crosenth@covad.com> 2602 2603 wget - Contributed by permission of Covad Communications 2604 2605=for html <br> 2606 2607Pavel Roskin <proski@gnu.org> 2608 2609 Lots of bugs fixes and patches. 2610 2611=for html <br> 2612 2613Gyepi Sam <gyepi@praxis-sw.com> 2614 2615 Remote logging feature for syslogd 2616 2617=for html <br> 2618 2619Linus Torvalds <torvalds@transmeta.com> 2620 2621 mkswap, fsck.minix, mkfs.minix 2622 2623=for html <br> 2624 2625Mark Whitley <markw@lineo.com> 2626 2627 sed remix, bug fixes, style-guide, etc. 2628 2629=for html <br> 2630 2631Charles P. Wright <cpwright@villagenet.com> 2632 2633 gzip, mini-netcat(nc) 2634 2635=for html <br> 2636 2637Enrique Zanardi <ezanardi@ull.es> 2638 2639 tarcat (since removed), loadkmap, various fixes, Debian maintenance 2640 2641=cut 2642 2643# $Id: busybox.pod,v 1.1.1.1 2008/10/15 03:28:34 james26_jang Exp $ 2644