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