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