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