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