Added expr, from Edward Betts <edward@debian.org>, with some fixups
[oweals/busybox.git] / docs / busybox.sgml
1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [...]>
2 <book id="BusyBoxDocumentation">
3  <bookinfo>
4   <title>BusyBox - The Swiss Army Knife of Embedded Linux</title>
5   
6   <legalnotice>
7    <para>
8      This documentation is free software; you can redistribute
9      it and/or modify it under the terms of the GNU General Public
10      License as published by the Free Software Foundation; either
11      version 2 of the License, or (at your option) any later
12      version.
13    </para>
14       
15    <para>
16      This program is distributed in the hope that it will be
17      useful, but WITHOUT ANY WARRANTY; without even the implied
18      warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19      See the GNU General Public License for more details.
20    </para>
21       
22    <para>
23      You should have received a copy of the GNU General Public
24      License along with this program; if not, write to the Free
25      Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26      MA 02111-1307 USA
27    </para>
28       
29    <para>
30      For more details see the file COPYING in the source
31      distribution of Linux.
32    </para>
33   </legalnotice>
34  </bookinfo>
35
36 <toc></toc>
37   <chapter id="Introduction">
38      <title>Introduction</title>
39
40         <para>
41         BusyBox combines tiny versions of many common UNIX utilities into a single
42         small executable. It provides minimalist replacements for most of the
43         utilities you usually find in fileutils, shellutils, findutils, textutils,
44         grep, gzip, tar, etc. BusyBox provides a fairly complete POSIX environment
45         for any small or embedded system. The utilities in BusyBox generally have
46         fewer options than their full-featured GNU cousins; however, the options
47         that are included provide the expected functionality and behave very much
48         like their GNU counterparts. 
49         </para>
50
51         <para>
52         BusyBox has been written with size-optimization and limited resources in
53         mind. It is also extremely modular so you can easily include or exclude
54         commands (or features) at compile time. This makes it easy to customize
55         your embedded systems. To create a working system, just add a kernel, a
56         shell (such as ash), and an editor (such as elvis-tiny or ae).
57         </para>
58   </chapter>
59
60   <chapter id="Syntax">
61      <title>How to use BusyBox</title>
62         <sect1 id="How to use BusyBox">
63             <title>Syntax</title
64
65             <para>
66             <screen>
67              BusyBox &lt;function&gt; [arguments...]  # or
68             </screen>
69             </para>
70
71             <para>
72             <screen>
73              &lt;function&gt; [arguments...]          # if symlinked
74             </screen>
75             </para>
76         </sect1>
77
78         <sect1 id="Invoking BusyBox">
79             <para>
80             When you create a link to BusyBox for the function you wish to use, when
81             BusyBox is called using that link it will behave as if the command itself
82             has been invoked.
83             </para>
84
85             <para>
86             For example, entering
87             </para>
88
89             <para>
90             <screen>
91                     ln -s ./BusyBox ls
92                     ./ls
93             </screen>
94             </para>
95
96             <para>
97             will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiled
98             into BusyBox). 
99             </para>
100
101             <para>
102             You can also invoke BusyBox by issuing the command as an argument on the
103             command line. For example, entering
104             </para>
105
106             <para>
107             <screen>
108                     ./BusyBox ls
109             </screen>
110             </para>
111
112             <para>
113             will also cause BusyBox to behave as 'ls'. 
114             </para>
115
116         </sect1>
117
118         <sect1 id="Common options">
119             <para>
120             Most BusyBox commands support the <emphasis>--help</emphasis> option to provide 
121             a terse runtime description of their behavior. 
122             </para>
123         </sect1>
124   </chapter>
125
126   <chapter id="Commands">
127      <title>BusyBox Commands</title>
128         <sect1 id="Available BusyBox Commands">
129             <title>Available BusyBox Commands</title>
130                 <para>
131                 Currently defined functions include:
132                 </para>
133
134                 <para>
135                 ar, basename, cat, chgrp, chmod, chown, chroot, chvt, clear,
136                 cp, cut, date, dc, dd, deallocvt, df, dirname, dmesg, du,
137                 dumpkmap, dutmp, echo, false, fbset, fdflush, find, free,
138                 freeramdisk, fsck.minix, grep, gunzip, gzip, halt, head,
139                 hostid, hostname, id, init, insmod, kill, killall, length, ln,
140                 loadacm, loadfont, loadkmap, logger, logname, ls, lsmod,
141                 makedevs, mkdir, mkfifo, mkfs.minix, mknod, mkswap, mktemp,
142                 more, mount, mt, mv, nc, nslookup, ping, poweroff, printf, ps,
143                 pwd, reboot, renice, reset, rm, rmdir, rmmod, sed, setkeycodes, sh, sleep,
144                 sort, swapoff, swapon, sync, syslogd, tail, tar, tee, telnet,
145                 test, touch, tr, true, tty, umount, uname, uniq, update,
146                 uptime, usleep, uudecode, uuencode, wc, which, whoami, yes,
147                 zcat, [
148                 </para>
149         </sect1>
150
151         <sect1 id="ar">
152             <title>ar</title>
153
154                 <para>
155                 Usage: ar [OPTION] archive [FILENAME]...
156                 </para>
157
158                 <para>
159                 Extract or list files from an ar archive.
160                 </para>
161
162                 <para>
163                 Options:
164                 </para>
165
166                 <para>
167                 <screen>
168                         o       Preserve original dates
169                         p       Extract to stdout
170                         t       List
171                         x       Extract
172                         v       Verbosely list files processed
173                 </screen>
174                 </para>
175         </sect1>
176
177         <sect1 id="basename">
178             <title>basename</title>
179                 <para>
180                 Usage: basename FILE [SUFFIX]
181                 </para>
182
183                 <para>
184                 Strip directory path and suffixes from FILE. If specified, also removes
185                 any trailing SUFFIX.
186                 </para>
187
188                 <para>
189                 Example:
190                 </para>
191
192                 <para>
193                 <screen>
194                         $ basename /usr/local/bin/foo
195                         foo
196                         $ basename /usr/local/bin/
197                         bin
198                         $ basename /foo/bar.txt .txt
199                         bar
200                 </screen>
201                 </para>
202         </sect1>
203
204         <sect1 id="cat">
205             <title>cat</title>
206
207                 <para>
208                 Usage: cat [FILE]...
209                 </para>
210
211                 <para>
212                 Concatenate <literal>FILE(s)</literal> and prints them to the standard
213                 output.
214                 </para>
215
216                 <para>
217                 Example:
218                 </para>
219
220                 <para>
221                 <screen>
222                         $ cat /proc/uptime
223                         110716.72 17.67
224                 </screen>
225                 </para>
226         </sect1>
227
228         <sect1 id="chgrp">
229             <title>chgrp</title>
230
231                 <para>
232                 Usage: chgrp [OPTION]... GROUP FILE...
233                 </para>
234
235                 <para>
236                 Change the group membership of each FILE to GROUP.
237                 </para>
238
239                 <para>
240                 Options:
241                 </para>
242
243                 <para>
244                 <screen>
245                         -R      Change files and directories recursively
246                 </screen>
247                 </para>
248
249                 <para>
250                 Example:
251                 </para>
252
253                 <para>
254                 <screen>
255                         $ ls -l /tmp/foo
256                         -r--r--r--    1 andersen andersen        0 Apr 12 18:25 /tmp/foo
257                         $ chgrp root /tmp/foo
258                         $ ls -l /tmp/foo
259                         -r--r--r--    1 andersen root            0 Apr 12 18:25 /tmp/foo
260                 </screen>
261                 </para>
262         </sect1>
263
264         <sect1 id="chmod">
265             <title>chmod</title>
266
267                 <para>
268                 Usage: chmod [<emphasis>-R</emphasis>] MODE[,MODE]... FILE...
269                 </para>
270
271                 <para>
272                 Change file access permissions for the specified
273                 <literal>FILE(s)</literal> (or directories). Each MODE is defined by
274                 combining the letters for WHO has access to the file, an OPERATOR for
275                 selecting how the permissions should be changed, and a PERMISSION for
276                 <literal>FILE(s)</literal> (or directories).
277                 </para>
278
279                 <para>
280                 WHO may be chosen from
281                 </para>
282
283                 <para>
284                 <screen>
285                         u       User who owns the file
286                         g       Users in the file's Group
287                         o       Other users not in the file's group
288                         a       All users
289                 </screen>
290                 </para>
291
292                 <para>
293                 OPERATOR may be chosen from
294                 </para>
295
296                 <para>
297                 <screen>
298                         +       Add a permission
299                         -       Remove a permission
300                         =       Assign a permission
301                 </screen>
302                 </para>
303
304                 <para>
305                 PERMISSION may be chosen from
306                 </para>
307
308                 <para>
309                 <screen>
310                         r       Read
311                         w       Write
312                         x       Execute (or access for directories)
313                         s       Set user (or group) ID bit
314                         t       Sticky bit (for directories prevents removing files by non-owners)
315                 </screen>
316                 </para>
317
318                 <para>
319                 Alternately, permissions can be set numerically where the first three
320                 numbers are calculated by adding the octal values, such as
321                 </para>
322
323                 <para>
324                 <screen>
325                         4       Read
326                         2       Write
327                         1       Execute
328                 </screen>
329                 </para>
330
331                 <para>
332                 An optional fourth digit can also be used to specify
333                 </para>
334
335                 <para>
336                 <screen>
337                         4       Set user ID
338                         2       Set group ID
339                         1       Sticky bit
340                 </screen>
341                 </para>
342
343                 <para>
344                 Options:
345                 </para>
346
347                 <para>
348                 <screen>
349                         -R      Change files and directories recursively.
350                 </screen>
351                 </para>
352
353                 <para>
354                 Example:
355                 </para>
356
357                 <para>
358                 <screen>
359                         $ ls -l /tmp/foo
360                         -rw-rw-r--    1 root     root            0 Apr 12 18:25 /tmp/foo
361                         $ chmod u+x /tmp/foo
362                         $ ls -l /tmp/foo
363                         -rwxrw-r--    1 root     root            0 Apr 12 18:25 /tmp/foo*
364                         $ chmod 444 /tmp/foo
365                         $ ls -l /tmp/foo
366                         -r--r--r--    1 root     root            0 Apr 12 18:25 /tmp/foo
367                 </screen>
368                 </para>
369         </sect1>
370         
371         <sect1 id="chown">
372             <title>chown</title>
373                 <para>
374                 Usage: chown [OPTION]... OWNER[&lt;.|:&gt;[GROUP] FILE...
375                 </para>
376
377                 <para>
378                 Change the owner and/or group of each FILE to OWNER and/or GROUP.
379                 </para>
380
381                 <para>
382                 Options:
383                 </para>
384
385                 <para>
386                 <screen>
387                         -R      Change files and directories recursively
388                 </screen>
389                 </para>
390
391                 <para>
392                 Example:
393                 </para>
394
395                 <para>
396                 <screen>
397                         $ ls -l /tmp/foo
398                         -r--r--r--    1 andersen andersen        0 Apr 12 18:25 /tmp/foo
399                         $ chown root /tmp/foo
400                         $ ls -l /tmp/foo
401                         -r--r--r--    1 root     andersen        0 Apr 12 18:25 /tmp/foo
402                         $ chown root.root /tmp/foo
403                         ls -l /tmp/foo
404                         -r--r--r--    1 root     root            0 Apr 12 18:25 /tmp/foo
405                 </screen>
406                 </para>
407         </sect1>
408
409         <sect1 id="chroot">
410             <title>chroot</title>
411                 <para>
412                 Usage: chroot NEWROOT [COMMAND...]
413                 </para>
414
415                 <para>
416                 Run COMMAND with root directory set to NEWROOT.
417                 </para>
418
419                 <para>
420                 Example:
421                 </para>
422
423                 <para>
424                 <screen>
425                         $ ls -l /bin/ls
426                         lrwxrwxrwx    1 root     root          12 Apr 13 00:46 /bin/ls -&gt; /BusyBox
427                         $ mount /dev/hdc1 /mnt -t minix
428                         $ chroot /mnt
429                         $ ls -l /bin/ls
430                         -rwxr-xr-x    1 root     root        40816 Feb  5 07:45 /bin/ls*
431                 </screen>
432                 </para>
433         </sect1>
434
435         <sect1 id="chvt">
436             <title>chvt</title>
437                 <para>
438                 Usage: chvt N
439                 </para>
440
441                 <para>
442                 Change the foreground virtual terminal to /dev/ttyN
443                 </para>
444         </sect1>
445
446         <sect1 id="clear">
447             <title>clear</title>
448
449                 <para>
450                 Usage: clear
451                 </para>
452
453                 <para>
454                 Clear the screen.
455                 </para>
456         </sect1>
457
458         <sect1 id="cp">
459             <title>cp</title>
460
461                 <para>
462                 Usage: cp [OPTION]... SOURCE DEST
463                 </para>
464
465                 <para>
466                 <screen>
467                    or: cp [OPTION]... SOURCE... DIRECTORY
468                 </screen>
469                 </para>
470
471                 <para>
472                 Copy SOURCE to DEST, or multiple <literal>SOURCE(s)</literal> to
473                 DIRECTORY.
474                 </para>
475
476                 <para>
477                 Options:
478                 </para>
479
480                 <para>
481                 <screen>
482                         -a      Same as -dpR
483                         -d      Preserve links
484                         -p      Preserve file attributes if possible
485                         -R      Copy directories recursively
486                 </screen>
487                 </para>
488         </sect1>
489
490         <sect1 id="cut">
491             <title>cut</title>
492
493                 <para>
494                 Usage: cut [OPTION]... [FILE]...
495                 </para>
496
497                 <para>
498                 Print selected fields from each input FILE to standard output.
499                 </para>
500
501                 <para>
502                 Options:
503                 </para>
504
505                 <para>
506                 <screen>
507                                 -b LIST Output only bytes from LIST
508                                 -c LIST Output only characters from LIST
509                                 -d CHAR Use CHAR instead of tab as the field delimiter
510                                 -s      Output only the lines containing delimiter
511                                 -f N    Print only these fields
512                                 -n      Ignored
513                 </screen>
514                 </para>
515
516                 <para>
517                 Example:
518                 </para>
519
520                 <para>
521                 <screen>
522                         $ echo "Hello world" | cut -f 1 -d ' '
523                         Hello
524                         $ echo "Hello world" | cut -f 2 -d ' '
525                         world
526                 </screen>
527                 </para>
528         </sect1>
529
530         <sect1 id="date">
531             <title>date</title>
532
533                 <para>
534                 Usage: date [OPTION]... [+FORMAT]
535                 </para>
536
537                 <para>
538                 <screen>
539                   or:  date [OPTION] [MMDDhhmm[[CC]YY][.ss]]
540                 </screen>
541                 </para>
542
543                 <para>
544                 Display the current time in the given FORMAT, or set the system date.
545                 </para>
546
547                 <para>
548                 Options:
549                 </para>
550
551                 <para>
552                 <screen>
553                         -R      Output RFC-822 compliant date string
554                         -s      Set time described by STRING
555                         -u      Print or set Coordinated Universal Time
556                 </screen>
557                 </para>
558
559                 <para>
560                 Example:
561                 </para>
562
563                 <para>
564                 <screen>
565                         $ date
566                         Wed Apr 12 18:52:41 MDT 2000
567                 </screen>
568                 </para>
569         </sect1>
570
571         <sect1 id="dc">
572             <title>dc</title>
573
574                 <para>
575                 Usage: dc [EXPRESSION]
576                 </para>
577
578                 <para>
579                 This is a Tiny RPN calculator that understands the
580                 following operations: +, -, /, *, and, or, not, eor. If
581                 no arguments are given, dc will process input from
582                 stdin.
583                 </para>
584
585                 <para>
586                 The behaviour of BusyBox/dc deviates (just a little ;-)
587                 from GNU/dc, but this will be remedied in the future.
588                 </para>
589
590                 <para>
591                 Example:
592                 </para>
593
594                 <para>
595                 <screen>
596                         $ dc 2 2 +
597                         4
598                         $ dc 8 8 \* 2 2 + /
599                         16
600                         $ dc 0 1 and
601                         0
602                         $ dc 0 1 or
603                         1
604                         $ echo 72 9 div 8 mul | dc
605                         64
606                 </screen>
607                 </para>
608         </sect1>
609
610         <sect1 id="dd">
611             <title>dd</title>
612
613                 <para>
614                 Usage: dd [OPTION]...
615                 </para>
616
617                 <para>
618                 Copy a file, converting and formatting according to
619                 options.
620                 </para>
621
622                 <para>
623                 Options:
624                 </para>
625
626                 <para>
627                 <screen>
628                         if=FILE Read from FILE instead of stdin
629                         of=FILE Write to FILE instead of stdout
630                         bs=N    Read and write N bytes at a time
631                         count=N Copy only N input blocks
632                         skip=N  Skip N input blocks
633                         seek=N  Skip N output blocks
634                 </screen>
635                 </para>
636
637                 <para>
638                 Numbers may be suffixed by w (x2), k (x1024), b (x512),
639                 or M (x1024^2).
640                 </para>
641
642                 <para>
643                 Example:
644                 </para>
645
646                 <para>
647                 <screen>
648                         $ dd if=/dev/zero of=/dev/ram1 bs=1M count=4
649                         4+0 records in
650                         4+0 records out
651                 </screen>
652                 </para>
653         </sect1>
654
655         <sect1 id="deallocvt">
656             <title>deallocvt</title>
657
658                 <para>
659                 Usage: deallocvt N
660                 </para>
661
662                 <para>
663                 Deallocate unused virtual terminal /dev/ttyN.
664                 </para>
665         </sect1>
666
667         <sect1 id="df">
668             <title>df</title>
669
670                 <para>
671                 Usage: df [FILE]...
672                 </para>
673
674                 <para>
675                 Print the filesystem space used and space available.
676                 </para>
677
678                 <para>
679                 Example:
680                 </para>
681
682                 <para>
683                 <screen>
684                         $ df
685                         Filesystem           1k-blocks      Used Available Use% Mounted on
686                         /dev/sda3              8690864   8553540    137324  98% /
687                         /dev/sda1                64216     36364     27852  57% /boot
688                         $ df /dev/sda3
689                         Filesystem           1k-blocks      Used Available Use% Mounted on
690                         /dev/sda3              8690864   8553540    137324  98% /
691                 </screen>
692                 </para>
693         </sect1>
694         
695         <sect1 id="dirname">
696             <title>dirname</title>
697
698                 <para>
699                 Usage: dirname NAME
700                 </para>
701
702                 <para>
703                 Strip non-directory suffix from NAME.
704                 </para>
705
706                 <para>
707                 Example:
708                 </para>
709
710                 <para>
711                 <screen>
712                         $ dirname /tmp/foo
713                         /tmp
714                         $ dirname /tmp/foo/
715                         /tmp
716                 </screen>
717                 </para>
718         </sect1>
719
720         <sect1 id="dmesg">
721             <title>dmesg</title>
722
723                 <para>
724                 Usage: dmesg [OPTION]...
725                 </para>
726
727                 <para>
728                 Print or control the kernel ring buffer.
729                 </para>
730
731                 <para>
732                 Options:
733                 </para>
734
735                 <para>
736                 <screen>
737                         -c              Clear the ring buffer after printing
738                         -n LEVEL        Set the console logging level to LEVEL
739                         -s BUFSIZE      Query ring buffer using a buffer of BUFSIZE
740                 </screen>
741                 </para>
742         </sect1>
743
744         <sect1 id="du">
745             <title>du</title>
746
747                 <para>
748                 Usage: du [OPTION]... [FILE]...
749                 </para>
750
751                 <para>
752                 Summarize the disk space used for each FILE or current
753                 directory.  Disk space printed in units of 1k (i.e.
754                 1024 bytes).
755                 </para>
756
757                 <para>
758                 Options:
759                 </para>
760
761                 <para>
762                 <screen>
763                         -l      Count sizes many times if hard linked
764                         -s      Display only a total for each argument
765                 </screen>
766                 </para>
767
768                 <para>
769                 Example:
770                 </para>
771
772                 <para>
773                 <screen>
774                         $ du
775                         16      ./CVS
776                         12      ./kernel-patches/CVS
777                         80      ./kernel-patches
778                         12      ./tests/CVS
779                         36      ./tests
780                         12      ./scripts/CVS
781                         16      ./scripts
782                         12      ./docs/CVS
783                         104     ./docs
784                         2417    .
785                 </screen>
786                 </para>
787         </sect1>
788
789         <sect1 id="dumpkmap">
790             <title>dumpkmap</title>
791
792                 <para>
793                 Usage: dumpkmap
794                 </para>
795
796                 <para>
797                 Prints out a binary keyboard translation table to standard input.
798                 </para>
799
800                 <para>
801                 Example:
802                 </para>
803
804                 <para>
805                 <screen>
806                         $ dumpkmap &lt; keymap
807                 </screen>
808                 </para>
809         </sect1>
810
811         <sect1 id="dutmp">
812             <title>dutmp</title>
813
814                 <para>
815                 Usage: dutmp [FILE]
816                 </para>
817
818                 <para>
819                 Dump utmp file format (pipe delimited) from FILE or
820                 stdin to stdout.
821                 </para>
822
823                 <para>
824                 Example:
825                 </para>
826
827                 <para>
828                 <screen>
829                         $ dutmp /var/run/utmp
830                         8|7||si|||0|0|0|955637625|760097|0
831                         2|0|~|~~|reboot||0|0|0|955637625|782235|0
832                         1|20020|~|~~|runlevel||0|0|0|955637625|800089|0
833                         8|125||l4|||0|0|0|955637629|998367|0
834                         6|245|tty1|1|LOGIN||0|0|0|955637630|998974|0
835                         6|246|tty2|2|LOGIN||0|0|0|955637630|999498|0
836                         7|336|pts/0|vt00andersen|andersen|:0.0|0|0|0|955637763|0|0
837                 </screen>
838                 </para>
839         </sect1>
840
841         <sect1 id="echo">
842             <title>echo</title>
843
844                 <para>
845                 Usage: echo [OPTION]... [ARG]...
846                 </para>
847
848                 <para>
849                 Print ARGs to stdout.
850                 </para>
851
852                 <para>
853                 Options:
854                 </para>
855
856                 <para>
857                 <screen>
858                         -n      Suppress trailing newline
859                         -e      Enable interpretation of escaped characters
860                         -E      Disable interpretation of escaped characters
861                 </screen>
862                 </para>
863
864                 <para>
865                 Example:
866                 </para>
867
868                 <para>
869                 <screen>
870                         $ echo "Erik is cool"
871                         Erik is cool
872                         $ echo -e "Erik\nis\ncool"
873                         Erik
874                         is
875                         cool
876                         $ echo "Erik\nis\ncool"
877                         Erik\nis\ncool
878                 </screen>
879                 </para>
880         </sect1>
881
882         <sect1 id="expr">
883             <title>expr</title>
884
885                 <para>
886                 Usage: expr EXPRESSION
887                 </para>
888
889                 <para>
890                 Prints the value of EXPRESSION to standard output.
891                 </para>
892
893                 <para>
894                 EXPRESSION may be:
895                 </para>
896
897                 <para>
898                 <screen>
899                         ARG1 |  ARG2    ARG1 if it is neither null nor 0, otherwise ARG2
900                         ARG1 &  ARG2    ARG1 if neither argument is null or 0, otherwise 0
901                         ARG1 &lt  ARG2    ARG1 is less than ARG2
902                         ARG1 &lt= ARG2    ARG1 is less than or equal to ARG2
903                         ARG1 =  ARG2    ARG1 is equal to ARG2
904                         ARG1 != ARG2    ARG1 is unequal to ARG2
905                         ARG1 &gt= ARG2    ARG1 is greater than or equal to ARG2
906                         ARG1 &gt  ARG2    ARG1 is greater than ARG2
907                         ARG1 +  ARG2    arithmetic sum of ARG1 and ARG2
908                         ARG1 -  ARG2    arithmetic difference of ARG1 and ARG2
909                         ARG1 *  ARG2    arithmetic product of ARG1 and ARG2
910                         ARG1 /  ARG2    arithmetic quotient of ARG1 divided by ARG2
911                         ARG1 %  ARG2    arithmetic remainder of ARG1 divided by ARG2
912                         STRING : REGEXP             anchored pattern match of REGEXP in STRING
913                         match STRING REGEXP         same as STRING : REGEXP
914                         substr STRING POS LENGTH    substring of STRING, POS counted from 1
915                         index STRING CHARS          index in STRING where any CHARS is found, or 0
916                         length STRING               length of STRING
917                         quote TOKEN                 interpret TOKEN as a string, even if it is a
918                                                         keyword like `match' or an operator like `/'
919                         ( EXPRESSION )              value of EXPRESSION
920                 </screen>
921                 </para>
922
923                 <para>
924                 Beware that many operators need to be escaped or quoted for shells.
925                 Comparisons are arithmetic if both ARGs are numbers, else
926                 lexicographical.  Pattern matches return the string matched between
927                 \( and \) or null; if \( and \) are not used, they return the number
928                 of characters matched or 0.
929                 </para>
930
931         </sect1>
932
933
934         <sect1 id="false">
935             <title>false</title>
936
937                 <para>
938                 Usage: false
939                 </para>
940
941                 <para>
942                 Return an exit code of FALSE (1).
943                 </para>
944
945                 <para>
946                 Example:
947                 </para>
948
949                 <para>
950                 <screen>
951                         $ false
952                         $ echo $?
953                         1
954                 </screen>
955                 </para>
956         </sect1>
957
958         <sect1 id="fbset">
959             <title>fbset</title>
960
961                 <para>
962                 Usage: fbset [OPTION]... [MODE]
963                 </para>
964
965                 <para>
966                 Show and modify frame buffer device settings.
967                 </para>
968
969                 <para>
970                 Options:
971                 </para>
972
973                 <para>
974                 <screen>
975                         -h                                              Display option summary
976                         -fb DEVICE                                      Operate on DEVICE
977                         -db FILE                                        Use FILE for mode database
978                         -g XRES YRES VXRES VYRES DEPTH                  Set all geometry parameters
979                         -t PIXCLOCK LEFT RIGHT UPPER LOWER HSLEN VSLEN  Set all timing parameters
980                         -xres RES                                       Set visible horizontal resolution
981                         -yres RES                                       Set visible vertical resolution
982                 </screen>
983                 </para>
984
985                 <para>
986                 Example:
987                 </para>
988
989                 <para>
990                 <screen>
991                         $ fbset
992                         mode "1024x768-76"
993                                         # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz
994                                         geometry 1024 768 1024 768 16
995                                         timings 12714 128 32 16 4 128 4
996                                         accel false
997                                         rgba 5/11,6/5,5/0,0/0
998                         endmode
999                 </screen>
1000                 </para>
1001         </sect1>
1002
1003         <sect1 id="fdflush">
1004             <title>fdflush</title>
1005
1006                 <para>
1007                 Usage: fdflush DEVICE
1008                 </para>
1009
1010                 <para>
1011                 Force floppy disk drive to detect disk change on DEVICE.
1012                 </para>
1013         </sect1>
1014
1015         <sect1 id="find">
1016             <title>find</title>
1017
1018                 <para>
1019                 Usage: find [PATH]... [EXPRESSION]
1020                 </para>
1021
1022                 <para>
1023                 Search for files in a directory hierarchy. The default
1024                 PATH is the current directory; default EXPRESSION is
1025                 '-print'.
1026                 </para>
1027
1028                 <para>
1029                 EXPRESSION may consist of:
1030                 </para>
1031
1032                 <para>
1033                 <screen>
1034                         -follow         Dereference symbolic links
1035                         -name PATTERN   File name (leading directories removed) matches PATTERN
1036                         -print          Print the full file name followed by a newline to stdout
1037                 </screen>
1038                 </para>
1039
1040                 <para>
1041                 Example:
1042                 </para>
1043
1044                 <para>
1045                 <screen>
1046                         $ find / -name /etc/passwd
1047                         /etc/passwd
1048                 </screen>
1049                 </para>
1050         </sect1>
1051
1052         <sect1 id="free">
1053             <title>free</title>
1054
1055                 <para>
1056                 Usage: free
1057                 </para>
1058
1059                 <para>
1060                 Displays the amount of free and used system memory.
1061                 </para>
1062
1063                 <para>
1064                 Example:
1065                 </para>
1066
1067                 <para>
1068                 <screen>
1069                         $ free
1070                         total         used         free       shared      buffers
1071                           Mem:       257628       248724         8904        59644        93124
1072                          Swap:       128516         8404       120112
1073                         Total:       386144       257128       129016
1074                 </screen>
1075                 </para>
1076         </sect1>
1077
1078         <sect1 id="freeramdisk">
1079             <title>freeramdisk</title>
1080
1081                 <para>
1082                 Usage: freeramdisk DEVICE
1083                 </para>
1084
1085                 <para>
1086                 Free all memory used by the ramdisk DEVICE.
1087                 </para>
1088
1089                 <para>
1090                 Example:
1091                 </para>
1092
1093                 <para>
1094                 <screen>
1095                         $ freeramdisk /dev/ram2
1096                 </screen>
1097                 </para>
1098         </sect1>
1099
1100         <sect1 id="fsck.minix">
1101             <title>fsck.minix</title>
1102
1103                 <para>
1104                 Usage: fsck.minix [OPTION]... DEVICE
1105                 </para>
1106
1107                 <para>
1108                 Perform a consistency check on the MINIX filesystem on
1109                 DEVICE.
1110                 </para>
1111
1112                 <para>
1113                 Options:
1114                 </para>
1115
1116                 <para>
1117                 <screen>
1118                         -l      List all filenames
1119                         -r      Perform interactive repairs
1120                         -a      Perform automatic repairs
1121                         -v      Verbose
1122                         -s      Output super-block information
1123                         -m      Activate MINIX-like "mode not cleared" warnings
1124                         -f      Force file system check.
1125                 </screen>
1126                 </para>
1127         </sect1>
1128         
1129         <sect1 id="getopt">
1130             <title>getopt</title>
1131
1132                 <para>
1133                 Usage: getopt [OPTIONS]...
1134                 </para>
1135
1136                 <para>
1137                 Parse command options
1138                 </para>
1139
1140                 <para>
1141                 <screen>
1142                    -a, --alternative            Allow long options starting with single -\n"
1143                    -l, --longoptions=longopts   Long options to be recognized\n"
1144                    -n, --name=progname          The name under which errors are reported\n"
1145                    -o, --options=optstring      Short options to be recognized\n"
1146                    -q, --quiet                  Disable error reporting by getopt(3)\n"
1147                    -Q, --quiet-output           No normal output\n"
1148                    -s, --shell=shell            Set shell quoting conventions\n"
1149                    -T, --test                   Test for getopt(1) version\n"
1150                    -u, --unqote                 Do not quote the output\n"
1151                 </screen>
1152                 </para>
1153
1154
1155                 <para>
1156                 Example:
1157                 </para>
1158
1159                 <para>
1160                 <screen>
1161                         $ cat getopt.test
1162                         #!/bin/sh
1163                         GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \
1164                                 -n 'example.busybox' -- "$@"`
1165                         if [ $? != 0 ] ; then  exit 1 ; fi
1166                         eval set -- "$GETOPT"
1167                         while true ; do
1168                           case $1 in
1169                             -a|--a-long) echo "Option a" ; shift ;;
1170                             -b|--b-long) echo "Option b, argument \`$2'" ; shift 2 ;;
1171                             -c|--c-long)
1172                               case "$2" in
1173                                 "") echo "Option c, no argument"; shift 2 ;;
1174                                 *)  echo "Option c, argument \`$2'" ; shift 2 ;;
1175                               esac ;;
1176                             --) shift ; break ;;
1177                             *) echo "Internal error!" ; exit 1 ;;
1178                           esac
1179                         done
1180                 </screen>
1181                 </para>
1182         </sect1>
1183
1184         <sect1 id="grep">
1185             <title>grep</title>
1186
1187                 <para>
1188                 Usage: grep [OPTIONS]... PATTERN [FILE]...
1189                 </para>
1190
1191                 <para>
1192                 Search for PATTERN in each FILE or stdin.
1193                 </para>
1194
1195                 <para>
1196                 Options:
1197                 </para>
1198
1199                 <para>
1200                 <screen>
1201                         -h      Suppress the prefixing filename on output
1202                         -i      Ignore case distinctions
1203                         -n      Print line number with output lines
1204                         -q      Be quiet. Returns 0 if result was found, 1 otherwise
1205                         -v      Select non-matching lines
1206                 </screen>
1207                 </para>
1208
1209                 <para>
1210                 This version of grep matches full regular expressions.
1211                 </para>
1212
1213                 <para>
1214                 Example:
1215                 </para>
1216
1217                 <para>
1218                 <screen>
1219                         $ grep root /etc/passwd
1220                         root:x:0:0:root:/root:/bin/bash
1221                         $ grep ^[rR]oo. /etc/passwd
1222                         root:x:0:0:root:/root:/bin/bash
1223                 </screen>
1224                 </para>
1225         </sect1>
1226
1227         <sect1 id="gunzip">
1228             <title>gunzip</title>
1229
1230                 <para>
1231                 Usage: gunzip [OPTION]... FILE
1232                 </para>
1233
1234                 <para>
1235                 Uncompress FILE (or stdin if FILE is '-').
1236                 </para>
1237
1238                 <para>
1239                 Options:
1240                 </para>
1241
1242                 <para>
1243                 <screen>
1244                         -c      Write output to standard output
1245                         -t      Test compressed file integrity
1246                 </screen>
1247                 </para>
1248
1249                 <para>
1250                 Example:
1251                 </para>
1252
1253                 <para>
1254                 <screen>
1255                         $ ls -la /tmp/BusyBox*
1256                         -rw-rw-r--    1 andersen andersen   557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz
1257                         $ gunzip /tmp/BusyBox-0.43.tar.gz
1258                         $ ls -la /tmp/BusyBox*
1259                         -rw-rw-r--    1 andersen andersen  1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1260                 </screen>
1261                 </para>
1262         </sect1>
1263
1264 <       <sect1 id="gzip">
1265             <title>gzip</title>
1266
1267                 <para>
1268                 Usage: gzip [OPTION]... FILE
1269                 </para>
1270
1271                 <para>
1272                 Compress FILE (or stdin if FILE is '-') with maximum
1273                 compression to FILE.gz (or stdout if FILE is '-').
1274                 </para>
1275
1276                 <para>
1277                 Options:
1278                 </para>
1279
1280                 <para>
1281                 <screen>
1282                         -c      Write output to standard output
1283                 </screen>
1284                 </para>
1285
1286                 <para>
1287                 Example:
1288                 </para>
1289
1290                 <para>
1291                 <screen>
1292                         $ ls -la /tmp/BusyBox*
1293                         -rw-rw-r--    1 andersen andersen  1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1294                         $ gzip /tmp/BusyBox-0.43.tar
1295                         $ ls -la /tmp/BusyBox*
1296                         -rw-rw-r--    1 andersen andersen   554058 Apr 14 17:49 /tmp/BusyBox-0.43.tar.gz
1297                 </screen>
1298                 </para>
1299         </sect1>
1300
1301         <sect1 id="halt">
1302             <title>halt</title>
1303
1304                 <para>
1305                 Usage: halt
1306                 </para>
1307
1308                 <para>
1309                 Halt the system.
1310                 </para>
1311         </sect1>
1312
1313         <sect1 id="head">
1314             <title>head</title>
1315
1316                 <para>
1317                 Usage: head [OPTION] FILE...
1318                 </para>
1319
1320                 <para>
1321                 Print first 10 lines of each FILE to standard output.
1322                 With more than one FILE, precede each with a header
1323                 giving the file name. With no FILE, or when FILE is -,
1324                 read standard input.
1325                 </para>
1326
1327                 <para>
1328                 Options:
1329                 </para>
1330
1331                 <para>
1332                 <screen>
1333                         -n NUM  Print first NUM lines instead of first 10
1334                 </screen>
1335                 </para>
1336
1337                 <para>
1338                 Example:
1339                 </para>
1340
1341                 <para>
1342                 <screen>
1343                         $ head -n 2 /etc/passwd
1344                         root:x:0:0:root:/root:/bin/bash
1345                         daemon:x:1:1:daemon:/usr/sbin:/bin/sh
1346                 </screen>
1347                 </para>
1348         </sect1>
1349
1350         <sect1 id="hostid">
1351             <title>hostid</title>
1352
1353                 <para>
1354                 Usage: hostid
1355                 </para>
1356
1357                 <para>
1358                 Prints out a unique 32-bit identifier for the current
1359                 machine. The 32-bit identifier is intended to be unique
1360                 among all UNIX systems in existence. 
1361                 </para>
1362         </sect1>
1363
1364         <sect1 id="hostname">
1365             <title>hostname</title>
1366
1367                 <para>
1368                 Usage: hostname [OPTION]... [HOSTNAME|-F FILE]
1369                 </para>
1370
1371                 <para>
1372                 Get or set the hostname or DNS domain name. If a
1373                 hostname is given (or a file with the -F parameter), the
1374                 host name will be set.
1375                 </para>
1376
1377                 <para>
1378                 Options:
1379                 </para>
1380
1381                 <para>
1382                 <screen>
1383                         -s      Short
1384                         -i      Addresses for the hostname
1385                         -d      DNS domain name
1386                         -F FILE Use the contents of FILE to specify the hostname
1387                 </screen>
1388                 </para>
1389
1390                 <para>
1391                 Example:
1392                 </para>
1393
1394                 <para>
1395                 <screen>
1396                         $ hostname
1397                         slag
1398                 </screen>
1399                 </para>
1400         </sect1>
1401
1402         <sect1 id="id">
1403             <title>id</title>
1404
1405                 <para>
1406                 Usage: id [OPTION]... [USERNAME]
1407                 </para>
1408
1409                 <para>
1410                 Print information for USERNAME or the current user.
1411                 </para>
1412
1413                 <para>
1414                 Options:
1415                 </para>
1416
1417                 <para>
1418                 <screen>
1419                         -g      Print only the group ID
1420                         -u      Print only the user ID
1421                         -r      Print the real user ID instead of the effective ID (with -ug)
1422                 </screen>
1423                 </para>
1424
1425                 <para>
1426                 Example:
1427                 </para>
1428
1429                 <para>
1430                 <screen>
1431                         $ id
1432                         uid=1000(andersen) gid=1000(andersen)
1433                 </screen>
1434                 </para>
1435         </sect1>
1436
1437         <sect1 id="init">
1438             <title>init</title>
1439
1440                 <para>
1441                 Usage: init
1442                 </para>
1443
1444                 <para>
1445                 Init is the parent of all processes.
1446                 </para>
1447
1448                 <para>
1449                 This version of init is designed to be run only by the
1450                 kernel.
1451                 </para>
1452
1453                 <para>
1454                 BusyBox init doesn't support multiple runlevels. The
1455                 runlevels field of the /etc/inittab file is completely
1456                 ignored by BusyBox init. If you want runlevels, use
1457                 sysvinit.
1458                 </para>
1459
1460                 <para>
1461                 BusyBox init works just fine without an inittab. If no
1462                 inittab is found, it has the following default behavior:
1463                 </para>
1464
1465                 <para>
1466                 <screen>
1467                         ::sysinit:/etc/init.d/rcS
1468                         ::askfirst:/bin/sh
1469                 </screen>
1470                 </para>
1471
1472                 <para>
1473                 If it detects that /dev/console is _not_ a serial
1474                 console, it will also run:
1475                 </para>
1476
1477                 <para>
1478                 <screen>
1479                         tty2::askfirst:/bin/sh
1480                 </screen>
1481                 </para>
1482
1483                 <para>
1484                 If you choose to use an /etc/inittab file, the inittab
1485                 entry format is as follows:
1486                 </para>
1487
1488                 <para>
1489                 <screen>
1490                         &lt;id&gt;:&lt;runlevels&gt;:&lt;action&gt;:&lt;process&gt;
1491                 </screen>
1492                 <para>
1493
1494                 <sect2>
1495                     <title>id</title>
1496                         <para>
1497                         WARNING: This field has a non-traditional
1498                         meaning for BusyBox init!  The id field is used
1499                         by BusyBox init to specify the controlling tty
1500                         for the specified process to run on.  The
1501                         contents of this field are appended to "/dev/"
1502                         and used as-is.  There is no need for this field
1503                         to be unique, although if it isn't you may have
1504                         strange results.  If this field is left blank,
1505                         it is completely ignored.  Also note that if
1506                         BusyBox detects that a serial console is in use,
1507                         then all entries containing non-empty id fields
1508                         will _not_ be run.  BusyBox init does nothing
1509                         with utmp.  We don't need no stinkin' utmp.
1510                         </para>
1511                 </sect2>
1512
1513                 <sect2>
1514                     <title>runlevels</title>
1515
1516                         <para>
1517                         The runlevels field is completely ignored.
1518                         </para>
1519                 </sect2>
1520
1521                 <sect2>
1522                     <title>action</title>
1523
1524                         <para>
1525                         Valid actions include: sysinit, respawn,
1526                         askfirst, wait, once, and ctrlaltdel.
1527                         </para>
1528
1529                         <para>
1530                         askfirst acts just like respawn, but before
1531                         running the specified process it displays the
1532                         line "Please press Enter to activate this
1533                         console." and then waits for the user to press
1534                         enter before starting the specified process.
1535                         </para>
1536
1537                         <para>
1538                         Unrecognized actions (like initdefault) will
1539                         cause init to emit an error message, and then go
1540                         along with its business.
1541                         </para>
1542                 </sect2>
1543
1544                 <sect2>
1545                     <title>process</title>
1546
1547                         <para>
1548                         Specifies the process to be executed and its
1549                         command line.
1550                         </para>
1551                 </sect2>
1552
1553                 <para>
1554                 Example /etc/inittab file:
1555                 </para>
1556
1557                 <para>
1558                 <screen>
1559                         # This is run first except when booting in single-user mode.
1560                         #
1561                         ::sysinit:/etc/init.d/rcS
1562
1563                         # /bin/sh invocations on selected ttys
1564                         #
1565                         # Start an "askfirst" shell on the console (whatever that may be)
1566                         ::askfirst:/bin/sh
1567                         # Start an "askfirst" shell on /dev/tty2
1568                         tty2::askfirst:/bin/sh
1569
1570                         # /sbin/getty invocations for selected ttys
1571                         #
1572                         tty4::respawn:/sbin/getty 38400 tty4
1573                         tty5::respawn:/sbin/getty 38400 tty5
1574
1575                         # Example of how to put a getty on a serial line (for a terminal)
1576                         #
1577                         #ttyS0::respawn:/sbin/getty -L ttyS0 9600 vt100
1578                         #ttyS1::respawn:/sbin/getty -L ttyS1 9600 vt100
1579                         #
1580                         # Example how to put a getty on a modem line.
1581                         #ttyS2::respawn:/sbin/getty -x0 -s 57600 ttyS2
1582
1583                         # Stuff to do before rebooting
1584                         ::ctrlaltdel:/bin/umount -a -r &gt; /dev/null 2&gt;&amp;1
1585                         ::ctrlaltdel:/sbin/swapoff -a &gt; /dev/null 2&gt;&amp;1
1586                 </screen>
1587                 </para>
1588         </sect1>
1589
1590         <sect1 id="insmod">
1591             <title>insmod</title>
1592
1593                 <para>
1594                 Usage: insmod [OPTION]... MODULE [symbol=value]...
1595                 </para>
1596
1597                 <para>
1598                 Load MODULE into the kernel.
1599                 </para>
1600
1601                 <para>
1602                 Options:
1603                 </para>
1604
1605                 <para>
1606                 <screen>
1607                         -f      Force module to load into the wrong kernel version.
1608                         -k      Make module autoclean-able.
1609                         -v      Verbose output
1610                         -x      Do not export externs
1611                 </screen>
1612                 </para>
1613         </sect1>
1614
1615         <sect1 id="kill">
1616             <title>kill</title>
1617
1618                 <para>
1619                 Usage: kill [OPTION] PID...
1620                 </para>
1621
1622                 <para>
1623                 Send a signal (default is SIGTERM) to the specified
1624                 PID(s).
1625                 </para>
1626
1627                 <para>
1628                 Options:
1629                 </para>
1630
1631                 <para>
1632                 <screen>
1633                         -l      List all signal names and numbers
1634                         -SIG    Send signal SIG
1635                 </screen>
1636                 </para>
1637
1638                 <para>
1639                 Example:
1640                 </para>
1641
1642                 <para>
1643                 <screen>
1644                         $ ps | grep apache
1645                         252 root     root     S [apache]
1646                         263 www-data www-data S [apache]
1647                         264 www-data www-data S [apache]
1648                         265 www-data www-data S [apache]
1649                         266 www-data www-data S [apache]
1650                         267 www-data www-data S [apache]
1651                         $ kill 252
1652                 </screen>
1653                 </para>
1654         </sect1>
1655
1656         <sect1 id="killall">
1657             <title>killall</title>
1658
1659                 <para>
1660                 Usage: killall [OPTION] NAME...
1661                 </para>
1662
1663                 <para>
1664                 Send a signal (default is SIGTERM) to the specified
1665                 NAME(s).
1666                 </para>
1667
1668                 <para>
1669                 Options:
1670                 </para>
1671
1672                 <para>
1673                 <screen>
1674                         -l      List all signal names and numbers
1675                         -SIG    Send signal SIG
1676                 </screen>
1677                 </para>
1678
1679                 <para>
1680                 Example:
1681                 </para>
1682
1683                 <para>
1684                 <screen>
1685                         $ killall apache
1686                 </screen>
1687                 </para>
1688         </sect1>
1689
1690         <sect1 id="length">
1691             <title>length</title>
1692
1693                 <para>
1694                 Usage: length STRING
1695                 </para>
1696
1697                 <para>
1698                 Print the length of STRING.
1699                 </para>
1700
1701                 <para>
1702                 Example:
1703                 </para>
1704
1705                 <para>
1706                 <screen>
1707                         $ length "Hello"
1708                         5
1709                 </screen>
1710                 </para>
1711         </sect1>
1712
1713         <sect1 id="ln">
1714             <title>ln</title>
1715
1716                 <para>
1717                 Usage: ln [OPTION]... TARGET FILE|DIRECTORY
1718                 </para>
1719
1720                 <para>
1721                 Create a link named FILE or DIRECTORY to the specified
1722                 TARGET.  You may use '--' to indicate that all following
1723                 arguments are non-options.
1724                 </para>
1725
1726                 <para>
1727                 Options:
1728                 </para>
1729
1730                 <para>
1731                 <screen>
1732                         -s      Make symbolic link instead of hard link
1733                         -f      Remove existing destination file
1734                 </screen>
1735                 </para>
1736
1737                 <para>
1738                 Example:
1739                 </para>
1740
1741                 <para>
1742                 <screen>
1743                         $ ln -s BusyBox /tmp/ls
1744                         $ ls -l /tmp/ls
1745                         lrwxrwxrwx    1 root     root            7 Apr 12 18:39 ls -&gt; BusyBox*
1746                 </screen>
1747                 </para>
1748         </sect1>
1749
1750         <sect1 id="loadacm">
1751             <title>loadacm</title>
1752
1753                 <para>
1754                 Usage: loadacm
1755                 </para>
1756
1757                 <para>
1758                 Load an acm from stdin.
1759                 </para>
1760
1761                 <para>
1762                 Example:
1763                 </para>
1764
1765                 <para>
1766                 <screen>
1767                         $ loadacm &lt; /etc/i18n/acmname
1768                 </screen>
1769                 </para>
1770         </sect1>
1771
1772         <sect1 id="loadfont">
1773             <title>loadfont</title>
1774
1775                 <para>
1776                 Usage: loadfont
1777                 </para>
1778
1779                 <para>
1780                 Load a console font from stdin.
1781                 </para>
1782
1783                 <para>
1784                 Example:
1785                 </para>
1786
1787                 <para>
1788                 <screen>
1789                         $ loadfont &lt; /etc/i18n/fontname
1790                 </screen>
1791                 </para>
1792         </sect1>
1793
1794         <sect1 id="loadkmap">
1795             <title>loadkmap</title>
1796
1797                 <para>
1798                 Usage: loadkmap
1799                 </para>
1800
1801                 <para>
1802                 Load a binary keyboard translation table from stdin.
1803                 </para>
1804
1805                 <para>
1806                 Example:
1807                 </para>
1808
1809                 <para>
1810                 <screen>
1811                         $ loadkmap &lt; /etc/i18n/lang-keymap
1812                 </screen>
1813                 </para>
1814         </sect1>
1815
1816         <sect1 id="logger">
1817             <title>logger</title>
1818
1819                 <para>
1820                 Usage: logger [OPTION]... [MESSAGE]
1821                 </para>
1822
1823                 <para>
1824                 Write MESSAGE to the system log.  If MESSAGE is '-', log
1825                 stdin.
1826                 </para>
1827
1828                 <para>
1829                 Options:
1830                 </para>
1831
1832                 <para>
1833                 <screen>
1834                         -s      Log to stderr as well as the system log
1835                         -t      Log using the specified tag (defaults to user name)
1836                         -p      Enter the message with the specified priority
1837                                 This may be numerical or a ``facility.level'' pair
1838                 </screen>
1839                 </para>
1840
1841                 <para>
1842                 Example:
1843                 </para>
1844
1845                 <para>
1846                 <screen>
1847                         $ logger "hello"
1848                 </screen>
1849                 </para>
1850         </sect1>
1851
1852         <sect1 id="logname">
1853             <title>logname</title>
1854
1855                 <para>
1856                 Usage: logname
1857                 </para>
1858
1859                 <para>
1860                 Print the name of the current user.
1861                 </para>
1862
1863                 <para>
1864                 Example:
1865                 </para>
1866
1867                 <para>
1868                 <screen>
1869                         $ logname
1870                         root
1871                 </screen>
1872                 </para>
1873         </sect1>
1874
1875         <sect1 id="ls">
1876             <title>ls</title>
1877
1878                 <para>
1879                 Usage: ls [OPTION]... [FILE]...
1880                 </para>
1881
1882                 <para>
1883                 
1884                 </para>
1885
1886                 <para>
1887                 Options:
1888                 </para>
1889
1890                 <para>
1891                 <screen>
1892                         -a      Do not hide entries starting with .
1893                         -c      With  -l:  show ctime (the time of last
1894                                 modification of file status information)
1895                         -d      List directory entries instead of contents
1896                         -e      List both full date and full time
1897                         -l      Use a long listing format
1898                         -n      List numeric UIDs and GIDs instead of names
1899                         -p      Append indicator (one of /=@|) to entries
1900                         -u      With -l: show access time (the time of last
1901                                 access of the file)
1902                         -x      List entries by lines instead of by columns
1903                         -A      Do not list implied . and ..
1904                         -C      List entries by columns
1905                         -F      Append indicator (one of */=@|) to entries
1906                         -R      List subdirectories recursively
1907                 </screen>
1908                 </para>
1909
1910                 <para>
1911                 Example:
1912                 </para>
1913
1914                 <para>
1915                 <screen>
1916                 </screen>
1917                 </para>
1918         </sect1>
1919
1920         <sect1 id="lsmod">
1921             <title>lsmod</title>
1922
1923                 <para>
1924                 Usage: lsmod
1925                 </para>
1926
1927                 <para>
1928                 List currently loaded kernel modules.
1929                 </para>
1930         </sect1>
1931
1932         <sect1 id="makedevs">
1933             <title>makedevs</title>
1934
1935                 <para>
1936                 Usage: makedevsf NAME TYPE MAJOR MINOR FIRST LAST [s]
1937                 </para>
1938
1939                 <para>
1940                 Create a range of block or character special files.
1941                 </para>
1942
1943                 <para>
1944                 TYPE may be:
1945                 </para>
1946
1947                 <para>
1948                 <screen>
1949                         b       Make a block (buffered) device
1950                         c or u  Make a character (un-buffered) device
1951                         p       Make a named pipe. MAJOR and MINOR are ignored for named pipes
1952                 </screen>
1953                 </para>
1954
1955                 <para>
1956                 FIRST specifies the number appended to NAME to create
1957                 the first device.  LAST specifies the number of the last
1958                 item that should be created. If 's' is the last
1959                 argument, the base device is created as well.
1960                 </para>
1961
1962                 <para>
1963                 Example:
1964                 </para>
1965
1966                 <para>
1967                 <screen>
1968                         $ makedevs /dev/ttyS c 4 66 2 63
1969                         [creates ttyS2-ttyS63]
1970                         $ makedevs /dev/hda b 3 0 0 8 s
1971                         [creates hda,hda1-hda8]
1972                 </screen>
1973                 </para>
1974         </sect1>
1975
1976         <sect1 id="md5sum">
1977             <title>md5sum</title>
1978
1979                 <para>
1980                 Usage: md5sum [OPTION]... FILE...
1981                 </para>
1982
1983                 <para>
1984                 Print or check MD5 checksums.
1985                 </para>
1986
1987                 <para>
1988                 Options:
1989                 </para>
1990
1991                 <para>
1992                 <screen>
1993                         -b      Read files in binary mode
1994                         -c      Check MD5 sums against given list
1995                         -t      Read files in text mode (default)
1996                         -g      Read a string
1997                 </screen>
1998                 </para>
1999
2000                 <para>
2001                 The following two options are useful only when verifying
2002                 checksums:
2003                 </para>
2004
2005                 <para>
2006                 <screen>
2007                         -s      Don't output anything, status code shows success
2008                         -w      Warn about improperly formated MD5 checksum lines
2009                 </screen>
2010                 </para>
2011
2012                 <para>
2013                 Example:
2014                 </para>
2015
2016                 <para>
2017                 <screen>
2018                         $ md5sum busybox
2019                         6fd11e98b98a58f64ff3398d7b324003  busybox
2020                         $ md5sum -c
2021                         6fd11e98b98a58f64ff3398d7b324003  busybox
2022                         6fd11e98b98a58f64ff3398d7b324002  busybox
2023                         md5sum: MD5 check failed for 'busybox'
2024                         ^D
2025                 </screen>
2026                 </para>
2027         </sect1>
2028
2029         <sect1 id="mkdir">
2030             <title>mkdir</title>
2031
2032                 <para>
2033                 Usage: mkdir [OPTION]... DIRECTORY...
2034                 </para>
2035
2036                 <para>
2037                 Create the DIRECTORY(s), if they do not already exist.
2038                 </para>
2039
2040                 <para>
2041                 Options:
2042                 </para>
2043
2044                 <para>
2045                 <screen>
2046                         -m      Set permission mode (as in chmod), not rwxrwxrwx - umask
2047                         -p      No error if directory exists, make parent directories as needed
2048                 </screen>
2049                 </para>
2050
2051                 <para>
2052                 Example:
2053                 </para>
2054
2055                 <para>
2056                 <screen>
2057                         $ mkdir /tmp/foo
2058                         $ mkdir /tmp/foo
2059                         /tmp/foo: File exists
2060                         $ mkdir /tmp/foo/bar/baz
2061                         /tmp/foo/bar/baz: No such file or directory
2062                         $ mkdir -p /tmp/foo/bar/baz
2063                 </screen>
2064                 </para>
2065         </sect1>
2066
2067         <sect1 id="mkfifo">
2068             <title>mkfifo</title>
2069
2070                 <para>
2071                 Usage: mkfifo [OPTION] NAME
2072                 </para>
2073
2074                 <para>
2075                 Create a named pipe (identical to 'mknod NAME p').
2076                 </para>
2077
2078                 <para>
2079                 Options:
2080                 </para>
2081
2082                 <para>
2083                 <screen>
2084                         -m MODE Create the pipe using the specified mode (default a=rw)
2085                 </screen>
2086                 </para>
2087         </sect1>
2088
2089         <sect1 id="mkfs.minix">
2090             <title>mkfs.minix</title>
2091
2092                 <para>
2093                 Usage: mkfs.minix [OPTION]... NAME [BLOCKS]
2094                 </para>
2095
2096                 <para>
2097                 Make a MINIX filesystem.
2098                 </para>
2099
2100                 <para>
2101                 Options:
2102                 </para>
2103
2104                 <para>
2105                 <screen>
2106                         -c              Check the device for bad blocks
2107                         -n [14|30]      Specify the maximum length of filenames
2108                         -i              Specify the number of inodes for the filesystem
2109                         -l FILENAME     Read the bad blocks list from FILENAME
2110                         -v              Make a Minix version 2 filesystem
2111                 </screen>
2112                 </para>
2113         </sect1>
2114
2115         <sect1 id="mknod">
2116             <title>mknod</title>
2117
2118                 <para>
2119                 Usage: mknod [OPTION]... NAME TYPE MAJOR MINOR
2120                 </para>
2121
2122                 <para>
2123                 Create a special file (block, character, or pipe).
2124                 </para>
2125
2126                 <para>
2127                 Options:
2128                 </para>
2129
2130                 <para>
2131                 <screen>
2132                         -m      Create the special file using the specified mode (default a=rw)
2133                 </screen>
2134                 </para>
2135
2136                 <para>
2137                 TYPE may be:
2138                 </para>
2139
2140                 <para>
2141                 <screen>
2142                         b       Make a block (buffered) device
2143                         c or u  Make a character (un-buffered) device
2144                         p       Make a named pipe. MAJOR and MINOR are ignored for named pipes
2145                 </screen>
2146                 </para>
2147
2148                 <para>
2149                 Example:
2150                 </para>
2151
2152                 <para>
2153                 <screen>
2154                         $ mknod /dev/fd0 b 2 0 
2155                         $ mknod -m 644 /tmp/pipe p
2156                 </screen>
2157                 </para>
2158         </sect1>
2159
2160         <sect1 id="mkswap">
2161             <title>mkswap</title>
2162
2163                 <para>
2164                 Usage: mkswap [OPTION]... DEVICE [BLOCKS]
2165                 </para>
2166
2167                 <para>
2168                 Prepare a disk partition to be used as a swap partition.
2169                 </para>
2170
2171                 <para>
2172                 Options:
2173                 </para>
2174
2175                 <para>
2176                 <screen>
2177                         -c      Check for read-ability.
2178                         -v0     Make version 0 swap [max 128 Megs].
2179                         -v1     Make version 1 swap [big!] (default for kernels &gt; 2.1.117).
2180                         BLOCKS  Number of block to use (default is entire partition).
2181                 </screen>
2182                 </para>
2183         </sect1>
2184
2185         <sect1 id="mktemp">
2186             <title>mktemp</title>
2187
2188                 <para>
2189                 Usage: mktemp TEMPLATE
2190                 </para>
2191
2192                 <para>
2193                 Creates a temporary file with its name based on
2194                 TEMPLATE.  TEMPLATE is any name with six `Xs' (i.e.
2195                 /tmp/temp.XXXXXX).
2196                 </para>
2197
2198                 <para>
2199                 Example:
2200                 </para>
2201
2202                 <para>
2203                 <screen>
2204                         $ mktemp /tmp/temp.XXXXXX
2205                         /tmp/temp.mWiLjM
2206                         $ ls -la /tmp/temp.mWiLjM
2207                         -rw-------    1 andersen andersen        0 Apr 25 17:10 /tmp/temp.mWiLjM
2208                 </screen>
2209                 </para>
2210         </sect1>
2211
2212         <sect1 id="more">
2213             <title>more</title>
2214
2215                 <para>
2216                 Usage: more [FILE]...
2217                 </para>
2218
2219                 <para>
2220                 Page through text one screenful at a time.
2221                 </para>
2222
2223                 <para>
2224                 Example:
2225                 </para>
2226
2227                 <para>
2228                 <screen>
2229                         $ dmesg | more
2230                 </screen>
2231                 </para>
2232         </sect1>
2233
2234         <sect1 id="mount">
2235             <title>mount</title>
2236
2237                 <para>
2238                 Usage: mount [OPTION]...
2239                 </para>
2240
2241                 <para>
2242                 <screen>
2243                    or: mount [OPTION]... DEVICE DIRECTORY
2244                 </screen>
2245                 </para>
2246
2247                 <para>
2248                 Mount filesystems.
2249                 </para>
2250
2251                 <para>
2252                 Options:
2253                 </para>
2254
2255                 <para>
2256                 <screen>
2257                         -a      Mount all filesystems in /etc/fstab
2258                         -o      One of the many filesystem options listed below
2259                         -r      Mount the filesystem read-only
2260                         -t TYPE Specify the filesystem type
2261                         -w      Mount the filesystem read-write
2262                 </screen>
2263                 </para>
2264
2265                 <para>
2266                 Options for use with the -o flag:
2267                 </para>
2268
2269                 <para>
2270                 <screen>
2271                         async/sync      Writes are asynchronous / synchronous
2272                         atime/noatime   Enable / disable updates to inode access times
2273                         dev/nodev       Allow / disallow use of special device files
2274                         exec/noexec     Allow / disallow use of executable files
2275                         loop            Mount a file via loop device
2276                         suid/nosuid     Allow / disallow set-user-id-root programs
2277                         remount         Remount a currently mounted filesystem
2278                         ro/rw           Mount filesystem read-only / read-write
2279                 </screen>
2280                 </para>
2281
2282                 <para>
2283                 There are even more flags that are filesystem specific.
2284                 You'll have to see the written documentation for those.
2285                 </para>
2286
2287                 <para>
2288                 Example:
2289                 </para>
2290
2291                 <para>
2292                 <screen>
2293                         $ mount
2294                         /dev/hda3 on / type minix (rw)
2295                         proc on /proc type proc (rw)
2296                         devpts on /dev/pts type devpts (rw)
2297                         $ mount /dev/fd0 /mnt -t msdos -o ro
2298                         $ mount /tmp/diskimage /opt -t ext2 -o loop
2299                 </screen>
2300                 </para>
2301         </sect1>
2302
2303         <sect1 id="mt">
2304             <title>mt</title>
2305
2306                 <para>
2307                 Usage: mt [OPTION] OPCODE VALUE
2308                 </para>
2309
2310                 <para>
2311                 Control magnetic tape drive operation.
2312                 </para>
2313
2314                 <para>
2315                 Options:
2316                 </para>
2317
2318                 <para>
2319                 <screen>
2320                         -f DEVICE       Control DEVICE
2321                 </screen>
2322                 </para>
2323         </sect1>
2324
2325         <sect1 id="mv">
2326             <title>mv</title>
2327
2328                 <para>
2329                 Usage: mv SOURCE DEST
2330                 </para>
2331
2332                 <para>
2333                 <screen>
2334                    or: mv SOURCE... DIRECTORY
2335                 </screen>
2336                 </para>
2337
2338                 <para>
2339                 Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
2340                 </para>
2341
2342                 <para>
2343                 Example:
2344                 </para>
2345
2346                 <para>
2347                 <screen>
2348                         $ mv /tmp/foo /bin/bar
2349                 </screen>
2350                 </para>
2351         </sect1>
2352
2353         <sect1 id="nc">
2354             <title>nc</title>
2355
2356                 <para>
2357                 Usage: nc HOST PORT
2358                 </para>
2359
2360                 <para>
2361                 Open a pipe to HOST:PORT.
2362                 </para>
2363
2364                 <para>
2365                 Example:
2366                 </para>
2367
2368                 <para>
2369                 <screen>
2370                         $ nc foobar.somedomain.com 25
2371                         220 foobar ESMTP Exim 3.12 #1 Sat, 15 Apr 2000 00:03:02 -0600
2372                         help
2373                         214-Commands supported:
2374                         214-    HELO EHLO MAIL RCPT DATA AUTH
2375                         214     NOOP QUIT RSET HELP
2376                         quit
2377                         221 foobar closing connection
2378                 </screen>
2379                 </para>
2380         </sect1>
2381
2382         <sect1 id="nslookup">
2383             <title>nslookup</title>
2384
2385                 <para>
2386                 Usage: nslookup [HOST]
2387                 </para>
2388
2389                 <para>
2390                 Query the nameserver for the IP address of the given
2391                 HOST.
2392                 </para>
2393
2394                 <para>
2395                 Example:
2396                 </para>
2397
2398                 <para>
2399                 <screen>
2400                         $ nslookup localhost
2401                         Server:     default
2402                         Address:    default
2403
2404                         Name:       debian
2405                         Address:    127.0.0.1
2406                 </screen>
2407                 </para>
2408         </sect1>
2409
2410         <sect1 id="ping">
2411             <title>ping</title>
2412
2413                 <para>
2414                 Usage: ping [OPTION]... HOST
2415                 </para>
2416
2417                 <para>
2418                 Send ICMP ECHO_REQUEST packets to HOST.
2419                 </para>
2420
2421                 <para>
2422                 Options:
2423                 </para>
2424
2425                 <para>
2426                 <screen>
2427                         -c COUNT        Send only COUNT pings
2428                         -s SIZE         Send SIZE data bytes in packets (default=56)
2429                         -q              Quiet mode, only displays output at start and when finished
2430                 </screen>
2431                 </para>
2432
2433                 <para>
2434                 Example:
2435                 </para>
2436
2437                 <para>
2438                 <screen>
2439                         $ ping localhost
2440                         PING slag (127.0.0.1): 56 data bytes
2441                         64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=20.1 ms
2442
2443                         --- debian ping statistics ---
2444                         1 packets transmitted, 1 packets received, 0% packet loss
2445                         round-trip min/avg/max = 20.1/20.1/20.1 ms
2446                 </screen>
2447                 </para>
2448         </sect1>
2449
2450         <sect1 id="poweroff">
2451             <title>poweroff</title>
2452
2453                 <para>
2454                 Usage: poweroff
2455                 </para>
2456
2457                 <para>
2458                 Shut down the system, and request that the kernel turn
2459                 off power upon halting.
2460                 </para>
2461         </sect1>
2462
2463         <sect1 id="printf">
2464             <title>printf</title>
2465
2466                 <para>
2467                 Usage: printf FORMAT [ARGUMENT]...
2468                 </para>
2469
2470                 <para>
2471                 Format and print the given data in a manner similar to
2472                 the C printf command.
2473                 </para>
2474
2475                 <para>
2476                 Example:
2477                 </para>
2478
2479                 <para>
2480                 <screen>
2481                         $ printf "Val=%d\n" 5
2482                         Val=5
2483                 </screen>
2484                 </para>
2485         </sect1>
2486
2487         <sect1 id="ps">
2488             <title>ps</title>
2489
2490                 <para>
2491                 Usage: ps
2492                 </para>
2493
2494                 <para>
2495                 Report process status.  This version of ps accepts no
2496                 options.
2497                 </para>
2498
2499                 <para>
2500                 Options:
2501                 </para>
2502
2503                 <para>
2504                 <screen>
2505                 </screen>
2506                 </para>
2507
2508                 <para>
2509                 Example:
2510                 </para>
2511
2512                 <para>
2513                 <screen>
2514                         $ ps
2515                           PID  Uid      Gid State Command
2516                             1 root     root     S init
2517                             2 root     root     S [kflushd]
2518                             3 root     root     S [kupdate]
2519                             4 root     root     S [kpiod]
2520                             5 root     root     S [kswapd]
2521                           742 andersen andersen S [bash]
2522                           743 andersen andersen S -bash
2523                           745 root     root     S [getty]
2524                          2990 andersen andersen R ps
2525                 </screen>
2526                 </para>
2527         </sect1>
2528
2529         <sect1 id="pwd">
2530             <title>pwd</title>
2531
2532                 <para>
2533                 Usage: pwd
2534                 </para>
2535
2536                 <para>
2537                 Print the full filename of the current working
2538                 directory.
2539                 </para>
2540
2541                 <para>
2542                 Example:
2543                 </para>
2544
2545                 <para>
2546                 <screen>
2547                         $ pwd
2548                         /root
2549                 </screen>
2550                 </para>
2551         </sect1>
2552
2553         <sect1 id="rdate">
2554             <title>rdate</title>
2555
2556                 <para>
2557                 Usage: rdate [OPTION] HOST
2558                 </para>
2559
2560                 <para>
2561                 Get and possibly set the system date and time from a remote HOST.
2562                 </para>
2563
2564                 <para>
2565                 Options:
2566                 </para>
2567
2568                 <para>
2569                 <screen>
2570                         -s      Set the system date and time (default).
2571                         -p      Print the date and time.
2572                 </screen>
2573                 </para>
2574         </sect1>
2575
2576         <sect1 id="reboot">
2577             <title>reboot</title>
2578
2579                 <para>
2580                 Usage: reboot
2581                 </para>
2582
2583                 <para>
2584                 Reboot the system.
2585                 </para>
2586         </sect1>
2587
2588         <sect1 id="renice">
2589             <title>renice</title>
2590
2591                 <para>
2592                 Usage: renice priority pid [pid ...]
2593                 </para>
2594
2595                 <para>
2596                 Changes priority of running processes. Allowed priorities range
2597                 from 20 (the process runs only when nothing else is running) to 0
2598                 (default priority) to -20 (almost nothing else ever gets to run).
2599                 </para>
2600         </sect1>
2601
2602         <sect1 id="reset">
2603             <title>reset</title>
2604
2605                 <para>
2606                 Usage: reset
2607                 </para>
2608
2609                 <para>
2610                 Resets the screen.
2611                 </para>
2612         </sect1>
2613
2614         <sect1 id="rm">
2615             <title>rm</title>
2616
2617                 <para>
2618                 Usage: rm [OPTION]... FILE...
2619                 </para>
2620
2621                 <para>
2622                 Remove (unlink) the FILE(s).  You may use '--' to
2623                 indicate that all following arguments are non-options.
2624                 </para>
2625
2626                 <para>
2627                 Options:
2628                 </para>
2629
2630                 <para>
2631                 <screen>
2632                         -f              Remove existing destinations, never prompt
2633                         -r or -R        Remove the contents of directories recursively
2634                 </screen>
2635                 </para>
2636
2637                 <para>
2638                 Example:
2639                 </para>
2640
2641                 <para>
2642                 <screen>
2643                         $ rm -rf /tmp/foo
2644                 </screen>
2645                 </para>
2646         </sect1>
2647
2648         <sect1 id="rmdir">
2649             <title>rmdir</title>
2650
2651                 <para>
2652                 Usage: rmdir DIRECTORY...
2653                 </para>
2654
2655                 <para>
2656                 Remove DIRECTORY(s) if they are empty.
2657                 </para>
2658
2659                 <para>
2660                 Example:
2661                 </para>
2662
2663                 <para>
2664                 <screen>
2665                         $ rmdir /tmp/foo
2666                 </screen>
2667                 </para>
2668         </sect1>
2669
2670         <sect1 id="rmmod">
2671             <title>rmmod</title>
2672
2673                 <para>
2674                 Usage: rmmod [OPTION]... [MODULE]...
2675                 </para>
2676
2677                 <para>
2678                 Unload MODULE(s) from the kernel.
2679                 </para>
2680
2681                 <para>
2682                 Options:
2683                 </para>
2684
2685                 <para>
2686                 <screen>
2687                         -a      Try to remove all unused kernel modules
2688                 </screen>
2689                 </para>
2690
2691                 <para>
2692                 Example:
2693                 </para>
2694
2695                 <para>
2696                 <screen>
2697                         $ rmmod tulip
2698                 </screen>
2699                 </para>
2700         </sect1>
2701
2702         <sect1 id="sed">
2703             <title>sed</title>
2704
2705                 <para>
2706                 Usage: sed [OPTION]... SCRIPT [FILE]...
2707                 </para>
2708
2709                 <para>
2710                 Allowed sed scripts come in the following form:
2711                 </para>
2712
2713                 <para>
2714                 <screen>
2715                 ADDR [!] COMMAND
2716                 </screen>
2717                 </para>
2718
2719                 <para>
2720                 ADDR can be:
2721                 </para>
2722
2723                 <para>
2724                 <screen>
2725                         NUMBER    Match specified line number
2726                         $         Match last line
2727                         /REGEXP/  Match specified regexp
2728                 </screen>
2729                 </para>
2730
2731                 <para>
2732                 ! inverts the meaning of the match
2733                 </para>
2734
2735                 <para>
2736                 COMMAND can be:
2737                 </para>
2738
2739                 <para>
2740                 <screen>
2741                         s/regexp/replacement/[igp]
2742                                 which attempt to match regexp against the pattern space
2743                                 and if successful replaces the matched portion with replacement.
2744                         aTEXT
2745                                 which appends TEXT after the pattern space
2746                 </screen>
2747                 </para>
2748
2749                 <para>
2750                 This version of sed matches full regular expressions.
2751                 </para>
2752
2753                 <para>
2754                 Options:
2755                 </para>
2756
2757                 <para>
2758                 <screen>
2759                         -e      Add the script to the commands to be executed
2760                         -n      Suppress automatic printing of pattern space
2761                 </screen>
2762                 </para>
2763
2764                 <para>
2765                 Example:
2766                 </para>
2767
2768                 <para>
2769                 <screen>
2770                         $ echo "foo" | sed -e 's/f[a-zA-Z]o/bar/g'
2771                         bar
2772                 </screen>
2773                 </para>
2774         </sect1>
2775
2776         <sect1 id="setkeycodes">
2777             <title>setkeycodes</title>
2778
2779                 <para>
2780                 Usage: setkeycodes SCANCODE KEYCODE ...
2781                 </para>
2782
2783                 <para>
2784                 Set entries into the kernel's scancode-to-keycode map,
2785                 allowing unusual keyboards to generate usable keycodes.
2786                 </para>
2787
2788                 <para>
2789                 SCANCODE may be either xx or e0xx (hexadecimal), and
2790                 KEYCODE is given in decimal.
2791                 </para>
2792
2793                 <para>
2794                 Example:
2795                 </para>
2796
2797                 <para>
2798                 <screen>
2799                         $ setkeycodes e030 127
2800                 </screen>
2801                 </para>
2802         </sect1>
2803
2804
2805         <sect1 id="sh">
2806             <title>sh</title>
2807
2808                 <para>
2809                 Usage: sh
2810                 </para>
2811
2812                 <para>
2813                 lash -- the BusyBox LAme SHell (command interpreter)
2814                 </para>
2815
2816                 <para>
2817                 This command does not yet have proper documentation.  
2818                 </para>
2819
2820                 <para>
2821                 Use lash just as you would use any other shell. It
2822                 properly handles pipes, redirects, job control, can be
2823                 used as the shell for scripts (#!/bin/sh), and has a
2824                 sufficient set of builtins to do what is needed. It does
2825                 not (yet) support Bourne Shell syntax. If you need
2826                 things like ``if-then-else'', ``while'', and such, use
2827                 ash or bash. If you just need a very simple and
2828                 extremely small shell, this will do the job.
2829                 </para>
2830         </sect1>
2831
2832         <sect1 id="sleep">
2833             <title>sleep</title>
2834
2835                 <para>
2836                 Usage: sleep N
2837                 </para>
2838
2839                 <para>
2840                 Pause for N seconds.
2841                 </para>
2842
2843                 <para>
2844                 Example:
2845                 </para>
2846
2847                 <para>
2848                 <screen>
2849                         $ sleep 2
2850                         [2 second delay results]
2851                 </screen>
2852                 </para>
2853         </sect1>
2854
2855         <sect1 id="sort">
2856             <title>sort</title>
2857
2858                 <para>
2859                 Usage: sort [OPTION]... [FILE]...
2860                 </para>
2861
2862                 <para>
2863                 Sort lines of text in FILE(s).
2864                 </para>
2865
2866                 <para>
2867                 Options:
2868                 </para>
2869
2870                 <para>
2871                 <screen>
2872                         -n      Compare numerically
2873                         -r      Reverse after sorting
2874                 </screen>
2875                 </para>
2876
2877                 <para>
2878                 Example:
2879                 </para>
2880
2881                 <para>
2882                 <screen>
2883                         $ echo -e "e\nf\nb\nd\nc\na" | sort
2884                         a
2885                         b
2886                         c
2887                         d
2888                         e
2889                         f
2890                 </screen>
2891                 </para>
2892         </sect1>
2893
2894         <sect1 id="swapoff">
2895             <title>swapoff</title>
2896
2897                 <para>
2898                 Usage: swapoff [OPTION] [DEVICE]
2899                 </para>
2900
2901                 <para>
2902                 Stop swapping virtual memory pages on DEVICE.
2903                 </para>
2904
2905                 <para>
2906                 Options:
2907                 </para>
2908
2909                 <para>
2910                 <screen>
2911                         -a      Stop swapping on all swap devices
2912                 </screen>
2913                 </para>
2914         </sect1>
2915
2916         <sect1 id="swapon">
2917             <title>swapon</title>
2918
2919                 <para>
2920                 Usage: swapon [OPTION] [DEVICE]
2921                 </para>
2922
2923                 <para>
2924                 Start swapping virtual memory pages on the given device.
2925                 </para>
2926
2927                 <para>
2928                 Options:
2929                 </para>
2930
2931                 <para>
2932                 <screen>
2933                         -a      Start swapping on all swap devices
2934                 </screen>
2935                 </para>
2936         </sect1>
2937
2938         <sect1 id="sync">
2939             <title>sync</title>
2940
2941                 <para>
2942                 Usage: sync
2943                 </para>
2944
2945                 <para>
2946                 Write all buffered filesystem blocks to disk.
2947                 </para>
2948         </sect1>
2949
2950         <sect1 id="syslogd">
2951             <title>syslogd</title>
2952
2953                 <para>
2954                 Usage: syslogd [OPTION]...
2955                 </para>
2956
2957                 <para>
2958                 Linux system and kernel (provides klogd) logging
2959                 utility. Note that this version of syslogd/klogd ignores
2960                 /etc/syslog.conf.
2961                 </para>
2962
2963                 <para>
2964                 Options:
2965                 </para>
2966
2967                 <para>
2968                 <screen>
2969                         -m NUM  Interval between MARK lines (default=20min, 0=off)
2970                         -n      Run as a foreground process
2971                         -K      Do not start up the klogd process
2972                         -O FILE Use an alternate log file (default=/var/log/messages)
2973                         -R HOST[:PORT] Log messages to HOST on PORT (default=514) over UDP.
2974                 </screen>
2975                 </para>
2976
2977                 <para>
2978                 Example:
2979                 </para>
2980
2981                 <para>
2982                 <screen>
2983                 $ syslogd -R masterlog:514
2984                 $ syslogd -R 192.168.1.1:601
2985                 </screen>
2986                 </para>
2987         </sect1>
2988
2989         <sect1 id="tail">
2990             <title>tail</title>
2991
2992                 <para>
2993                 Usage: tail [OPTION] [FILE]...
2994                 </para>
2995
2996                 <para>
2997                 Print last 10 lines of each FILE to standard output.
2998                 With more than one FILE, precede each with a header
2999                 giving the file name. With no FILE, or when FILE is -,
3000                 read stdin.
3001                 </para>
3002
3003                 <para>
3004                 Options:
3005                 </para>
3006
3007                 <para>
3008                 <screen>
3009                         -n NUM  Print last NUM lines instead of last 10
3010                         -f      Output data as the file grows.  This version
3011                                 of 'tail -f' supports only one file at a time.
3012                 </screen>
3013                 </para>
3014
3015                 <para>
3016                 Example:
3017                 </para>
3018
3019                 <para>
3020                 <screen>
3021                         $ tail -n 1 /etc/resolv.conf
3022                         nameserver 10.0.0.1
3023                 </screen>
3024                 </para>
3025         </sect1>
3026
3027         <sect1 id="tar">
3028             <title>tar</title>
3029
3030                 <para>
3031                 Usage: tar [MODE] [OPTION] [FILE]...
3032                 </para>
3033
3034                 <para>
3035                 
3036                 </para>
3037
3038                 <para>
3039                 MODE may be chosen from
3040                 </para>
3041
3042                 <para>
3043                 <screen>
3044                         c       Create
3045                         x       Extract
3046                         t       List
3047                 </screen>
3048                 </para>
3049
3050                 <para>
3051                 Options:
3052                 </para>
3053
3054                 <para>
3055                 <screen>
3056                         f FILE                  Use FILE for tarfile (or stdin if '-')
3057                         O                               Extract to stdout
3058                         exclude FILE    File to exclude
3059                         v                               List files processed
3060                 </screen>
3061                 </para>
3062
3063                 <para>
3064                 Example:
3065                 </para>
3066
3067                 <para>
3068                 <screen>
3069                         $ zcat /tmp/tarball.tar.gz | tar -xf -
3070                         $ tar -cf /tmp/tarball.tar /usr/local
3071                 </screen>
3072                 </para>
3073         </sect1>
3074
3075         <sect1 id="tee">
3076             <title>tee</title>
3077
3078                 <para>
3079                 Usage: tee [OPTION]... [FILE]...
3080                 </para>
3081
3082                 <para>
3083                 Copy stdin to FILE(s), and also to stdout.
3084                 </para>
3085
3086                 <para>
3087                 Options:
3088                 </para>
3089
3090                 <para>
3091                 <screen>
3092                         -a      Append to the given FILEs, do not overwrite
3093                 </screen>
3094                 </para>
3095
3096                 <para>
3097                 Example:
3098                 </para>
3099
3100                 <para>
3101                 <screen>
3102                         $ echo "Hello" | tee /tmp/foo
3103                         Hello
3104                         $ cat /tmp/foo
3105                         Hello
3106                 </screen>
3107                 </para>
3108         </sect1>
3109
3110         <sect1 id="telnet">
3111             <title>telnet</title>
3112
3113                 <para>
3114                 Usage: telnet HOST [PORT]
3115                 </para>
3116
3117                 <para>
3118                 Establish interactive communication with another
3119                 computer over a network using the TELNET protocol.
3120                 </para>
3121         </sect1>
3122
3123         <sect1 id="test">
3124             <title>test, [</title>
3125
3126                 <para>
3127                 Usage: test EXPRESSION
3128                 </para>
3129
3130                 <para>
3131                 <screen>
3132                    or: [ EXPRESSION ]
3133
3134                 <para>
3135                 Check file types and compare values returning an exit
3136                 code determined by the value of EXPRESSION.
3137                 </para>
3138
3139                 <para>
3140                 Example:
3141                 </para>
3142
3143                 <para>
3144                 <screen>
3145                         $ test 1 -eq 2
3146                         $ echo $?
3147                         1
3148                         $ test 1 -eq 1
3149                         $ echo $?
3150                         0
3151                         $ [ -d /etc ]
3152                         $ echo $?
3153                         0
3154                         $ [ -d /junk ]
3155                         $ echo $?
3156                         1
3157                 </screen>
3158                 </para>
3159         </sect1>
3160
3161         <sect1 id="touch">
3162             <title>touch</title>
3163
3164                 <para>
3165                 Usage: touch [OPTION]... FILE...
3166                 </para>
3167
3168                 <para>
3169                 Update the last-modified date on (or create) FILE(s).
3170                 </para>
3171
3172                 <para>
3173                 Options:
3174                 </para>
3175
3176                 <para>
3177                 <screen>
3178                         -c      Do not create files
3179                 </screen>
3180                 </para>
3181
3182                 <para>
3183                 Example:
3184                 </para>
3185
3186                 <para>
3187                 <screen>
3188                         $ ls -l /tmp/foo
3189                         /bin/ls: /tmp/foo: No such file or directory
3190                         $ touch /tmp/foo
3191                         $ ls -l /tmp/foo
3192                         -rw-rw-r--    1 andersen andersen        0 Apr 15 01:11 /tmp/foo
3193                 </screen>
3194                 </para>
3195         </sect1>
3196
3197         <sect1 id="tr">
3198             <title>tr</title>
3199
3200                 <para>
3201                 Usage: tr [OPTION]... STRING1 [STRING2]
3202                 </para>
3203
3204                 <para>
3205                 Translate, squeeze, and/or delete characters from stdin,
3206                 writing to stdout.
3207                 </para>
3208
3209                 <para>
3210                 Options:
3211                 </para>
3212
3213                 <para>
3214                 <screen>
3215                         -c      Take complement of STRING1
3216                         -d      Delete input characters coded STRING1
3217                         -s      Squeeze multiple output characters of STRING2 into one character
3218                 </screen>
3219                 </para>
3220
3221                 <para>
3222                 Example:
3223                 </para>
3224
3225                 <para>
3226                 <screen>
3227                         $ echo "gdkkn vnqkc" | tr [a-y] [b-z]
3228                         hello world
3229                 </screen>
3230                 </para>
3231         </sect1>
3232
3233         <sect1 id="true">
3234             <title>true</title>
3235
3236                 <para>
3237                 Usage: true
3238                 </para>
3239
3240                 <para>
3241                 Return an exit code of TRUE (1).
3242                 </para>
3243
3244                 <para>
3245                 Example:
3246                 </para>
3247
3248                 <para>
3249                 <screen>
3250                         $ true
3251                         $ echo $?
3252                         0
3253                 </screen>
3254                 </para>
3255         </sect1>
3256
3257         <sect1 id="tty">
3258             <title>tty</title>
3259
3260                 <para>
3261                 Usage: tty
3262                 </para>
3263
3264                 <para>
3265                 Print the file name of the terminal connected to stdin.
3266                 </para>
3267
3268                 <para>
3269                 Options:
3270                 </para>
3271
3272                 <para>
3273                 <screen>
3274                         -s      Print nothing, only return an exit status
3275                 </screen>
3276                 </para>
3277
3278                 <para>
3279                 Example:
3280                 </para>
3281
3282                 <para>
3283                 <screen>
3284                         $ tty
3285                         /dev/tty2
3286                 </screen>
3287                 </para>
3288         </sect1>
3289
3290         <sect1 id="umount">
3291             <title>umount</title>
3292
3293                 <para>
3294                 Usage: umount [OPTION]... DEVICE|DIRECTORY
3295                 </para>
3296
3297                 <para>
3298                 
3299                 </para>
3300
3301                 <para>
3302                 Options:
3303                 </para>
3304
3305                 <para>
3306                 <screen>
3307                         -a      Unmount all file systems
3308                         -r      Try to remount devices as read-only if mount is busy
3309                         -f      Force filesystem umount (i.e. unreachable NFS server)
3310                         -l      Do not free loop device (if a loop device has been used)
3311                 </screen>
3312                 </para>
3313
3314                 <para>
3315                 Example:
3316                 </para>
3317
3318                 <para>
3319                 <screen>
3320                         $ umount /dev/hdc1 
3321                 </screen>
3322                 </para>
3323         </sect1>
3324
3325         <sect1 id="uname">
3326             <title>uname</title>
3327
3328                 <para>
3329                 Usage: uname [OPTION]...
3330                 </para>
3331
3332                 <para>
3333                 Print certain system information. With no OPTION, same
3334                 as -s.
3335                 </para>
3336
3337                 <para>
3338                 Options:
3339                 </para>
3340
3341                 <para>
3342                 <screen>
3343                         -a      Print all information
3344                         -m      Print the machine (hardware) type
3345                         -n      Print the machine's network node hostname
3346                         -r      Print the operating system release
3347                         -s      Print the operating system name
3348                         -p      Print the host processor type
3349                         -v      Print the operating system version
3350                 </screen>
3351                 </para>
3352
3353                 <para>
3354                 Example:
3355                 </para>
3356
3357                 <para>
3358                 <screen>
3359                         $ uname -a
3360                         Linux debian 2.2.15pre13 #5 Tue Mar 14 16:03:50 MST 2000 i686 unknown
3361                 </screen>
3362                 </para>
3363         </sect1>
3364
3365         <sect1 id="uniq">
3366             <title>uniq</title>
3367
3368                 <para>
3369                 Usage: uniq [INPUT [OUTPUT]]
3370                 </para>
3371
3372                 <para>
3373                 Discard all but one of successive identical lines from
3374                 INPUT (or stdin), writing to OUTPUT (or stdout).
3375                 </para>
3376
3377                 <para>
3378                 Example:
3379                 </para>
3380
3381                 <para>
3382                 <screen>
3383                         $ echo -e "a\na\nb\nc\nc\na" | sort | uniq
3384                         a
3385                         b
3386                         c
3387                 </screen>
3388                 </para>
3389         </sect1>
3390
3391         <sect1 id="update">
3392             <title>update</title>
3393
3394                 <para>
3395                 Usage: update [OPTION]...
3396                 </para>
3397
3398                 <para>
3399                 Periodically flush filesystem buffers.
3400                 </para>
3401
3402                 <para>
3403                 Options:
3404                 </para>
3405
3406                 <para>
3407                 <screen>
3408                         -S      Force use of sync(2) instead of flushing
3409                         -s SECS Call sync this often (default 30)
3410                         -f SECS Flush some buffers this often (default 5)
3411                 </screen>
3412                 </para>
3413         </sect1>
3414
3415         <sect1 id="uptime">
3416             <title>uptime</title>
3417
3418                 <para>
3419                 Usage: uptime
3420                 </para>
3421
3422                 <para>
3423                 Display how long the system has been running since boot.
3424                 </para>
3425
3426                 <para>
3427                 Example:
3428                 </para>
3429
3430                 <para>
3431                 <screen>
3432                         $ uptime
3433                           1:55pm  up  2:30, load average: 0.09, 0.04, 0.00
3434                 </screen>
3435                 </para>
3436         </sect1>
3437
3438         <sect1 id="usleep">
3439             <title>usleep</title>
3440
3441                 <para>
3442                 Usage: usleep N
3443                 </para>
3444
3445                 <para>
3446                 Pause for N microseconds.
3447                 </para>
3448
3449                 <para>
3450                 Example:
3451                 </para>
3452
3453                 <para>
3454                 <screen>
3455                         $ usleep 1000000
3456                         [pauses for 1 second]
3457                 </screen>
3458                 </para>
3459         </sect1>
3460
3461         <sect1 id="uudecode">
3462             <title>uudecode</title>
3463
3464                 <para>
3465                 Usage: uudecode [OPTION] [FILE]
3466                 </para>
3467
3468                 <para>
3469                 Uudecode a uuencoded file.
3470                 </para>
3471
3472                 <para>
3473                 Options:
3474                 </para>
3475
3476                 <para>
3477                 <screen>
3478                         -o FILE Direct output to FILE
3479                 </screen>
3480                 </para>
3481
3482                 <para>
3483                 Example:
3484                 </para>
3485
3486                 <para>
3487                 <screen>
3488                         $ uudecode -o busybox busybox.uu
3489                         $ ls -l busybox
3490                         -rwxr-xr-x   1 ams      ams        245264 Jun  7 21:35 busybox
3491                 </screen>
3492                 </para>
3493         </sect1>
3494
3495         <sect1 id="uuencode">
3496             <title>uuencode</title>
3497
3498                 <para>
3499                 Usage: uuencode [OPTION] [INFILE] OUTFILE
3500                 </para>
3501
3502                 <para>
3503                 Uuencode a file.
3504                 </para>
3505
3506                 <para>
3507                 Options:
3508                 </para>
3509
3510                 <para>
3511                 <screen>
3512                         -m      Use base64 encoding as of RFC1521
3513                 </screen>
3514                 </para>
3515
3516                 <para>
3517                 Example:
3518                 </para>
3519
3520                 <para>
3521                 <screen>
3522                         $ uuencode busybox busybox
3523                         begin 755 busybox
3524                         M?T5,1@$!`0````````````(``P`!````L+@$"#0```!0N@,``````#0`(``&amp;
3525                         .....
3526                         $ uudecode busybox busybox &gt; busybox.uu
3527                         $
3528                 </screen>
3529                 </para>
3530         </sect1>
3531
3532         <sect1 id="wc">
3533             <title>wc</title>
3534
3535                 <para>
3536                 Usage: wc [OPTION]... [FILE]...
3537                 </para>
3538
3539                 <para>
3540                 Print line, word, and byte counts for each FILE, and a
3541                 total line if more than one FILE is specified. With no
3542                 FILE, read stdin.
3543                 </para>
3544
3545                 <para>
3546                 Options:
3547                 </para>
3548
3549                 <para>
3550                 <screen>
3551                         -c      Print the byte counts
3552                         -l      Print the newline counts
3553                         -L      Print the length of the longest line
3554                         -w      Print the word counts
3555                 </screen>
3556                 </para>
3557
3558                 <para>
3559                 Example:
3560                 </para>
3561
3562                 <para>
3563                 <screen>
3564                         $ wc /etc/passwd
3565                              31      46    1365 /etc/passwd
3566                 </screen>
3567                 </para>
3568         </sect1>
3569
3570         <sect1 id="which">
3571             <title>which</title>
3572
3573                 <para>
3574                 Usage: which [COMMAND]...
3575                 </para>
3576
3577                 <para>
3578                 Locate COMMAND(s).
3579                 </para>
3580
3581                 <para>
3582                 Example:
3583                 </para>
3584
3585                 <para>
3586                 <screen>
3587                         $ which login
3588                         /bin/login
3589                 </screen>
3590                 </para>
3591         </sect1>
3592
3593         <sect1 id="whoami">
3594             <title>whoami</title>
3595
3596                 <para>
3597                 Usage: whoami
3598                 </para>
3599
3600                 <para>
3601                 Print the user name associated with the current
3602                 effective user id.
3603                 </para>
3604
3605                 <para>
3606                 Example:
3607                 </para>
3608
3609                 <para>
3610                 <screen>
3611                         $ whoami
3612                         andersen
3613                 </screen>
3614                 </para>
3615         </sect1>
3616
3617         <sect1 id="yes">
3618             <title>yes</title>
3619
3620                 <para>
3621                 Usage: yes [STRING]...
3622                 </para>
3623
3624                 <para>
3625                 Repeatedly output a line with all specified STRING(s),
3626                 or `y'.
3627                 </para>
3628         </sect1>
3629
3630         <sect1 id="zcat">
3631             <title>zcat</title>
3632
3633                 <para>
3634                 Usage: zcat [OPTION]... FILE
3635                 </para>
3636
3637                 <para>
3638                 Uncompress FILE (or stdin if FILE is '-') to stdout.  
3639                 </para>
3640
3641                 <para>
3642                 Options:
3643                 </para>
3644
3645                 <para>
3646                 <screen>
3647                         -t      Test compressed file integrity
3648                 </screen>
3649                 </para>
3650
3651                 <para>
3652                 Example:
3653                 </para>
3654
3655                 <para>
3656                 <screen>
3657                 </screen>
3658                 </para>
3659         </sect1>
3660   </chapter>
3661
3662   <chapter id="LIBC-NSS">
3663     <title>LIBC NSS</title>
3664
3665         <para>
3666         GNU Libc uses the Name Service Switch (NSS) to configure the
3667         behavior of the C library for the local environment, and to
3668         configure how it reads system data, such as passwords and group
3669         information. BusyBox has made it Policy that it will never use
3670         NSS, and will never use libc calls that make use of NSS. This
3671         allows you to run an embedded system without the need for
3672         installing an /etc/nsswitch.conf file and without /lib/libnss_*
3673         libraries installed.
3674         </para>
3675
3676         <para>
3677         If you are using a system that is using a remote LDAP server for
3678         authentication via GNU libc NSS, and you want to use BusyBox,
3679         then you will need to adjust the BusyBox source. Chances are
3680         though, that if you have enough space to install of that stuff
3681         on your system, then you probably want the full GNU utilities.
3682         </para>
3683   </chapter>
3684
3685   <chapter id="SEE-ALSO">
3686     <title>SEE ALSO</title>
3687
3688         <para>
3689         <literal>textutils(1),</literal>
3690         <literal>shellutils(1),</literal>
3691         etc...
3692         </para>
3693   </chapter>
3694
3695   <chapter id="MAINTAINER">
3696     <title>MAINTAINER</title>
3697
3698         <para>
3699         Erik Andersen &lt;andersee@debian.org&gt; &lt;andersen@lineo.com&gt;
3700         </para>
3701   </chapter>
3702
3703   <chapter id="AUTHORS">
3704     <title>AUTHORS</title>
3705
3706         <para>
3707         The following people have contributed code to BusyBox whether
3708         they know it or not.
3709         </para>
3710
3711         <para>
3712         Erik Andersen &lt;andersee@debian.org&gt;
3713         </para>
3714
3715         <para>
3716         John Beppu &lt;beppu@lineo.com&gt;
3717         </para>
3718
3719         <para>
3720         Brian Candler &lt;B.Candler@pobox.com&gt;
3721         </para>
3722
3723         <para>
3724         Randolph Chung &lt;tausq@debian.org&gt;
3725         </para>
3726
3727         <para>
3728         Dave Cinege &lt;dcinege@psychosis.com&gt;       
3729         </para>
3730
3731         <para>
3732         Karl M. Hegbloom &lt;karlheg@debian.org&gt;
3733         </para>
3734
3735         <para>
3736         John Lombardo &lt;john@deltanet.com&gt; 
3737         </para>
3738
3739         <para>
3740         Glenn McGrath &lt;bug1@netconnect.com.au&gt;
3741         </para>
3742
3743         <para>
3744         Bruce Perens &lt;bruce@perens.com&gt;
3745         </para>
3746
3747         <para>
3748         Pavel Roskin &lt;proski@gnu.org&gt;
3749         </para>
3750
3751         <para>
3752         Linus Torvalds &lt;torvalds@transmeta.com&gt;
3753         </para>
3754
3755         <para>
3756         Charles P. Wright &lt;cpwright@villagenet.com&gt;
3757         </para>
3758
3759         <para>
3760         Enrique Zanardi &lt;ezanardi@ull.es&gt;
3761         </para>
3762   </chapter>
3763 </book>    <!-- End of the book -->