blob: a8507ba2ce13876dd453322d747fe1cbe245b76e [file] [log] [blame]
Eric Andersencff3fe32000-09-20 19:22:26 +00001<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [ ]>
Eric Andersen53310252000-07-04 19:42:23 +00002<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>
Mark Whitley83a949c2000-06-26 13:31:53 +000035
Eric Andersen53310252000-07-04 19:42:23 +000036<toc></toc>
37 <chapter id="Introduction">
38 <title>Introduction</title>
Mark Whitley83a949c2000-06-26 13:31:53 +000039
Eric Andersen53310252000-07-04 19:42:23 +000040 <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>
Mark Whitley83a949c2000-06-26 13:31:53 +000050
Eric Andersen53310252000-07-04 19:42:23 +000051 <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>
Mark Whitley83a949c2000-06-26 13:31:53 +000059
Eric Andersen53310252000-07-04 19:42:23 +000060 <chapter id="Syntax">
61 <title>How to use BusyBox</title>
Pavel Roskind2d3aa32000-09-15 17:16:40 +000062 <sect1 id="How-to-use-BusyBox">
63 <title>Syntax</title>
Mark Whitley83a949c2000-06-26 13:31:53 +000064
Eric Andersen53310252000-07-04 19:42:23 +000065 <para>
66 <screen>
67 BusyBox &lt;function&gt; [arguments...] # or
68 </screen>
69 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +000070
Eric Andersen53310252000-07-04 19:42:23 +000071 <para>
72 <screen>
73 &lt;function&gt; [arguments...] # if symlinked
74 </screen>
75 </para>
76 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +000077
Pavel Roskind2d3aa32000-09-15 17:16:40 +000078 <sect1 id="Invoking-BusyBox">
79 <title>Invoking BusyBox</title>
80
Eric Andersen53310252000-07-04 19:42:23 +000081 <para>
82 When you create a link to BusyBox for the function you wish to use, when
83 BusyBox is called using that link it will behave as if the command itself
84 has been invoked.
85 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +000086
Eric Andersen53310252000-07-04 19:42:23 +000087 <para>
88 For example, entering
89 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +000090
Eric Andersen53310252000-07-04 19:42:23 +000091 <para>
92 <screen>
93 ln -s ./BusyBox ls
94 ./ls
95 </screen>
96 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +000097
Eric Andersen53310252000-07-04 19:42:23 +000098 <para>
99 will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiled
100 into BusyBox).
101 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000102
Eric Andersen53310252000-07-04 19:42:23 +0000103 <para>
104 You can also invoke BusyBox by issuing the command as an argument on the
105 command line. For example, entering
106 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000107
Eric Andersen53310252000-07-04 19:42:23 +0000108 <para>
109 <screen>
110 ./BusyBox ls
111 </screen>
112 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000113
Eric Andersen53310252000-07-04 19:42:23 +0000114 <para>
115 will also cause BusyBox to behave as 'ls'.
116 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000117
Eric Andersen53310252000-07-04 19:42:23 +0000118 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +0000119
Pavel Roskind2d3aa32000-09-15 17:16:40 +0000120 <sect1 id="Common-options">
121 <title>Common options</title>
122
Eric Andersen53310252000-07-04 19:42:23 +0000123 <para>
124 Most BusyBox commands support the <emphasis>--help</emphasis> option to provide
125 a terse runtime description of their behavior.
126 </para>
127 </sect1>
128 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +0000129
Eric Andersen53310252000-07-04 19:42:23 +0000130 <chapter id="Commands">
131 <title>BusyBox Commands</title>
Pavel Roskind2d3aa32000-09-15 17:16:40 +0000132 <sect1 id="Available-BusyBox-Commands">
Eric Andersen53310252000-07-04 19:42:23 +0000133 <title>Available BusyBox Commands</title>
134 <para>
135 Currently defined functions include:
136 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000137
Eric Andersen53310252000-07-04 19:42:23 +0000138 <para>
Eric Andersen61dc0572000-07-11 17:29:36 +0000139 ar, basename, cat, chgrp, chmod, chown, chroot, chvt, clear,
140 cp, cut, date, dc, dd, deallocvt, df, dirname, dmesg, du,
141 dumpkmap, dutmp, echo, false, fbset, fdflush, find, free,
142 freeramdisk, fsck.minix, grep, gunzip, gzip, halt, head,
143 hostid, hostname, id, init, insmod, kill, killall, length, ln,
144 loadacm, loadfont, loadkmap, logger, logname, ls, lsmod,
145 makedevs, mkdir, mkfifo, mkfs.minix, mknod, mkswap, mktemp,
146 more, mount, mt, mv, nc, nslookup, ping, poweroff, printf, ps,
Eric Andersenfa405d02000-08-21 21:18:52 +0000147 pwd, reboot, renice, reset, rm, rmdir, rmmod, sed, setkeycodes, sh, sleep,
Eric Andersen61dc0572000-07-11 17:29:36 +0000148 sort, swapoff, swapon, sync, syslogd, tail, tar, tee, telnet,
149 test, touch, tr, true, tty, umount, uname, uniq, update,
150 uptime, usleep, uudecode, uuencode, wc, which, whoami, yes,
151 zcat, [
Eric Andersen53310252000-07-04 19:42:23 +0000152 </para>
153 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +0000154
Eric Andersen53310252000-07-04 19:42:23 +0000155 <sect1 id="ar">
156 <title>ar</title>
Mark Whitley83a949c2000-06-26 13:31:53 +0000157
Eric Andersen53310252000-07-04 19:42:23 +0000158 <para>
Eric Andersen6f5e2812000-07-06 16:58:45 +0000159 Usage: ar [OPTION] archive [FILENAME]...
Eric Andersen53310252000-07-04 19:42:23 +0000160 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000161
Eric Andersen53310252000-07-04 19:42:23 +0000162 <para>
163 Extract or list files from an ar archive.
164 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000165
Eric Andersen53310252000-07-04 19:42:23 +0000166 <para>
167 Options:
168 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000169
Eric Andersen53310252000-07-04 19:42:23 +0000170 <para>
171 <screen>
Eric Andersen6f5e2812000-07-06 16:58:45 +0000172 o Preserve original dates
173 p Extract to stdout
174 t List
175 x Extract
176 v Verbosely list files processed
Eric Andersen53310252000-07-04 19:42:23 +0000177 </screen>
178 </para>
179 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +0000180
Eric Andersen53310252000-07-04 19:42:23 +0000181 <sect1 id="basename">
182 <title>basename</title>
183 <para>
184 Usage: basename FILE [SUFFIX]
185 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000186
Eric Andersen53310252000-07-04 19:42:23 +0000187 <para>
Eric Andersen6f5e2812000-07-06 16:58:45 +0000188 Strip directory path and suffixes from FILE. If specified, also removes
Eric Andersen53310252000-07-04 19:42:23 +0000189 any trailing SUFFIX.
190 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000191
Eric Andersen53310252000-07-04 19:42:23 +0000192 <para>
193 Example:
194 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000195
Eric Andersen53310252000-07-04 19:42:23 +0000196 <para>
197 <screen>
198 $ basename /usr/local/bin/foo
199 foo
200 $ basename /usr/local/bin/
201 bin
202 $ basename /foo/bar.txt .txt
203 bar
204 </screen>
205 </para>
206 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +0000207
Eric Andersen53310252000-07-04 19:42:23 +0000208 <sect1 id="cat">
209 <title>cat</title>
Mark Whitley83a949c2000-06-26 13:31:53 +0000210
Eric Andersen53310252000-07-04 19:42:23 +0000211 <para>
Eric Andersen6f5e2812000-07-06 16:58:45 +0000212 Usage: cat [FILE]...
Eric Andersen53310252000-07-04 19:42:23 +0000213 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000214
Eric Andersen53310252000-07-04 19:42:23 +0000215 <para>
Eric Andersen6f5e2812000-07-06 16:58:45 +0000216 Concatenate <literal>FILE(s)</literal> and prints them to the standard
Eric Andersen53310252000-07-04 19:42:23 +0000217 output.
218 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000219
Eric Andersen53310252000-07-04 19:42:23 +0000220 <para>
221 Example:
222 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000223
Eric Andersen53310252000-07-04 19:42:23 +0000224 <para>
225 <screen>
226 $ cat /proc/uptime
227 110716.72 17.67
228 </screen>
229 </para>
Eric Andersen53310252000-07-04 19:42:23 +0000230 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +0000231
Eric Andersen028fb622000-07-04 20:07:13 +0000232 <sect1 id="chgrp">
233 <title>chgrp</title>
Mark Whitley83a949c2000-06-26 13:31:53 +0000234
Eric Andersen028fb622000-07-04 20:07:13 +0000235 <para>
Eric Andersen6f5e2812000-07-06 16:58:45 +0000236 Usage: chgrp [OPTION]... GROUP FILE...
Eric Andersen028fb622000-07-04 20:07:13 +0000237 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000238
Eric Andersen028fb622000-07-04 20:07:13 +0000239 <para>
Eric Andersen6f5e2812000-07-06 16:58:45 +0000240 Change the group membership of each FILE to GROUP.
Eric Andersen028fb622000-07-04 20:07:13 +0000241 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000242
Eric Andersen028fb622000-07-04 20:07:13 +0000243 <para>
244 Options:
245 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000246
Eric Andersen028fb622000-07-04 20:07:13 +0000247 <para>
248 <screen>
Eric Andersen6f5e2812000-07-06 16:58:45 +0000249 -R Change files and directories recursively
250 </screen>
251 </para>
252
253 <para>
254 Example:
255 </para>
256
257 <para>
258 <screen>
259 $ ls -l /tmp/foo
260 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
261 $ chgrp root /tmp/foo
262 $ ls -l /tmp/foo
263 -r--r--r-- 1 andersen root 0 Apr 12 18:25 /tmp/foo
264 </screen>
265 </para>
266 </sect1>
267
268 <sect1 id="chmod">
269 <title>chmod</title>
270
271 <para>
272 Usage: chmod [<emphasis>-R</emphasis>] MODE[,MODE]... FILE...
273 </para>
274
275 <para>
276 Change file access permissions for the specified
277 <literal>FILE(s)</literal> (or directories). Each MODE is defined by
278 combining the letters for WHO has access to the file, an OPERATOR for
279 selecting how the permissions should be changed, and a PERMISSION for
280 <literal>FILE(s)</literal> (or directories).
281 </para>
282
283 <para>
284 WHO may be chosen from
285 </para>
286
287 <para>
288 <screen>
289 u User who owns the file
290 g Users in the file's Group
291 o Other users not in the file's group
292 a All users
293 </screen>
294 </para>
295
296 <para>
297 OPERATOR may be chosen from
298 </para>
299
300 <para>
301 <screen>
302 + Add a permission
303 - Remove a permission
304 = Assign a permission
305 </screen>
306 </para>
307
308 <para>
309 PERMISSION may be chosen from
310 </para>
311
312 <para>
313 <screen>
314 r Read
315 w Write
316 x Execute (or access for directories)
317 s Set user (or group) ID bit
318 t Sticky bit (for directories prevents removing files by non-owners)
319 </screen>
320 </para>
321
322 <para>
323 Alternately, permissions can be set numerically where the first three
324 numbers are calculated by adding the octal values, such as
325 </para>
326
327 <para>
328 <screen>
329 4 Read
330 2 Write
331 1 Execute
332 </screen>
333 </para>
334
335 <para>
336 An optional fourth digit can also be used to specify
337 </para>
338
339 <para>
340 <screen>
341 4 Set user ID
342 2 Set group ID
343 1 Sticky bit
344 </screen>
345 </para>
346
347 <para>
348 Options:
349 </para>
350
351 <para>
352 <screen>
353 -R Change files and directories recursively.
354 </screen>
355 </para>
356
357 <para>
358 Example:
359 </para>
360
361 <para>
362 <screen>
363 $ ls -l /tmp/foo
364 -rw-rw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo
365 $ chmod u+x /tmp/foo
366 $ ls -l /tmp/foo
367 -rwxrw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo*
368 $ chmod 444 /tmp/foo
369 $ ls -l /tmp/foo
370 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
371 </screen>
372 </para>
373 </sect1>
374
375 <sect1 id="chown">
376 <title>chown</title>
377 <para>
378 Usage: chown [OPTION]... OWNER[&lt;.|:&gt;[GROUP] FILE...
379 </para>
380
381 <para>
382 Change the owner and/or group of each FILE to OWNER and/or GROUP.
383 </para>
384
385 <para>
386 Options:
387 </para>
388
389 <para>
390 <screen>
391 -R Change files and directories recursively
Eric Andersen028fb622000-07-04 20:07:13 +0000392 </screen>
393 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000394
Eric Andersen028fb622000-07-04 20:07:13 +0000395 <para>
396 Example:
397 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000398
Eric Andersen028fb622000-07-04 20:07:13 +0000399 <para>
400 <screen>
401 $ ls -l /tmp/foo
402 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
403 $ chown root /tmp/foo
404 $ ls -l /tmp/foo
405 -r--r--r-- 1 root andersen 0 Apr 12 18:25 /tmp/foo
406 $ chown root.root /tmp/foo
407 ls -l /tmp/foo
408 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
409 </screen>
410 </para>
411 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +0000412
Eric Andersen028fb622000-07-04 20:07:13 +0000413 <sect1 id="chroot">
414 <title>chroot</title>
415 <para>
416 Usage: chroot NEWROOT [COMMAND...]
417 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000418
Eric Andersen028fb622000-07-04 20:07:13 +0000419 <para>
420 Run COMMAND with root directory set to NEWROOT.
421 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000422
Eric Andersen028fb622000-07-04 20:07:13 +0000423 <para>
424 Example:
425 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000426
Eric Andersen028fb622000-07-04 20:07:13 +0000427 <para>
428 <screen>
429 $ ls -l /bin/ls
430 lrwxrwxrwx 1 root root 12 Apr 13 00:46 /bin/ls -&gt; /BusyBox
431 $ mount /dev/hdc1 /mnt -t minix
432 $ chroot /mnt
433 $ ls -l /bin/ls
434 -rwxr-xr-x 1 root root 40816 Feb 5 07:45 /bin/ls*
435 </screen>
436 </para>
437 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +0000438
Eric Andersen028fb622000-07-04 20:07:13 +0000439 <sect1 id="chvt">
440 <title>chvt</title>
441 <para>
442 Usage: chvt N
443 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000444
Eric Andersen028fb622000-07-04 20:07:13 +0000445 <para>
Eric Andersen6f5e2812000-07-06 16:58:45 +0000446 Change the foreground virtual terminal to /dev/ttyN
Eric Andersen028fb622000-07-04 20:07:13 +0000447 </para>
448 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +0000449
Eric Andersen028fb622000-07-04 20:07:13 +0000450 <sect1 id="clear">
451 <title>clear</title>
Mark Whitley83a949c2000-06-26 13:31:53 +0000452
Eric Andersen028fb622000-07-04 20:07:13 +0000453 <para>
454 Usage: clear
455 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000456
Eric Andersen028fb622000-07-04 20:07:13 +0000457 <para>
Eric Andersen6f5e2812000-07-06 16:58:45 +0000458 Clear the screen.
Eric Andersen028fb622000-07-04 20:07:13 +0000459 </para>
460 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +0000461
Eric Andersen028fb622000-07-04 20:07:13 +0000462 <sect1 id="cp">
463 <title>cp</title>
Mark Whitley83a949c2000-06-26 13:31:53 +0000464
Eric Andersen028fb622000-07-04 20:07:13 +0000465 <para>
466 Usage: cp [OPTION]... SOURCE DEST
467 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000468
Eric Andersen028fb622000-07-04 20:07:13 +0000469 <para>
470 <screen>
471 or: cp [OPTION]... SOURCE... DIRECTORY
472 </screen>
473 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000474
Eric Andersen028fb622000-07-04 20:07:13 +0000475 <para>
Eric Andersen6f5e2812000-07-06 16:58:45 +0000476 Copy SOURCE to DEST, or multiple <literal>SOURCE(s)</literal> to
Eric Andersen028fb622000-07-04 20:07:13 +0000477 DIRECTORY.
478 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000479
Eric Andersen028fb622000-07-04 20:07:13 +0000480 <para>
481 Options:
482 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000483
Eric Andersen028fb622000-07-04 20:07:13 +0000484 <para>
485 <screen>
486 -a Same as -dpR
Eric Andersen6f5e2812000-07-06 16:58:45 +0000487 -d Preserve links
488 -p Preserve file attributes if possible
489 -R Copy directories recursively
Eric Andersen028fb622000-07-04 20:07:13 +0000490 </screen>
491 </para>
492 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +0000493
Eric Andersen028fb622000-07-04 20:07:13 +0000494 <sect1 id="cut">
495 <title>cut</title>
Mark Whitley83a949c2000-06-26 13:31:53 +0000496
Eric Andersen028fb622000-07-04 20:07:13 +0000497 <para>
498 Usage: cut [OPTION]... [FILE]...
499 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000500
Eric Andersen028fb622000-07-04 20:07:13 +0000501 <para>
Eric Andersen6f5e2812000-07-06 16:58:45 +0000502 Print selected fields from each input FILE to standard output.
Eric Andersen028fb622000-07-04 20:07:13 +0000503 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000504
Eric Andersen028fb622000-07-04 20:07:13 +0000505 <para>
506 Options:
507 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000508
Eric Andersen028fb622000-07-04 20:07:13 +0000509 <para>
510 <screen>
511 -b LIST Output only bytes from LIST
512 -c LIST Output only characters from LIST
513 -d CHAR Use CHAR instead of tab as the field delimiter
Pavel Roskin0010ee42000-07-21 15:10:57 +0000514 -s Output only the lines containing delimiter
Eric Andersen028fb622000-07-04 20:07:13 +0000515 -f N Print only these fields
516 -n Ignored
517 </screen>
518 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000519
Eric Andersen028fb622000-07-04 20:07:13 +0000520 <para>
521 Example:
522 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000523
Eric Andersen028fb622000-07-04 20:07:13 +0000524 <para>
525 <screen>
526 $ echo "Hello world" | cut -f 1 -d ' '
527 Hello
528 $ echo "Hello world" | cut -f 2 -d ' '
529 world
530 </screen>
531 </para>
532 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +0000533
Eric Andersen028fb622000-07-04 20:07:13 +0000534 <sect1 id="date">
535 <title>date</title>
Mark Whitley83a949c2000-06-26 13:31:53 +0000536
Eric Andersen028fb622000-07-04 20:07:13 +0000537 <para>
538 Usage: date [OPTION]... [+FORMAT]
539 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000540
Eric Andersen028fb622000-07-04 20:07:13 +0000541 <para>
542 <screen>
543 or: date [OPTION] [MMDDhhmm[[CC]YY][.ss]]
544 </screen>
545 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000546
Eric Andersen028fb622000-07-04 20:07:13 +0000547 <para>
Eric Andersen6f5e2812000-07-06 16:58:45 +0000548 Display the current time in the given FORMAT, or set the system date.
Eric Andersen028fb622000-07-04 20:07:13 +0000549 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000550
Eric Andersen028fb622000-07-04 20:07:13 +0000551 <para>
552 Options:
553 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000554
Eric Andersen028fb622000-07-04 20:07:13 +0000555 <para>
556 <screen>
Eric Andersen6f5e2812000-07-06 16:58:45 +0000557 -R Output RFC-822 compliant date string
558 -s Set time described by STRING
559 -u Print or set Coordinated Universal Time
Eric Andersen028fb622000-07-04 20:07:13 +0000560 </screen>
561 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000562
Eric Andersen028fb622000-07-04 20:07:13 +0000563 <para>
564 Example:
565 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +0000566
Eric Andersen028fb622000-07-04 20:07:13 +0000567 <para>
568 <screen>
569 $ date
570 Wed Apr 12 18:52:41 MDT 2000
571 </screen>
572 </para>
573 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +0000574
Eric Andersen6f5e2812000-07-06 16:58:45 +0000575 <sect1 id="dc">
576 <title>dc</title>
Mark Whitley83a949c2000-06-26 13:31:53 +0000577
Eric Andersen6f5e2812000-07-06 16:58:45 +0000578 <para>
579 Usage: dc [EXPRESSION]
580 </para>
581
582 <para>
583 This is a Tiny RPN calculator that understands the
584 following operations: +, -, /, *, and, or, not, eor. If
585 no arguments are given, dc will process input from
586 stdin.
587 </para>
588
589 <para>
590 The behaviour of BusyBox/dc deviates (just a little ;-)
591 from GNU/dc, but this will be remedied in the future.
592 </para>
593
594 <para>
595 Example:
596 </para>
597
598 <para>
599 <screen>
600 $ dc 2 2 +
601 4
602 $ dc 8 8 \* 2 2 + /
603 16
604 $ dc 0 1 and
605 0
606 $ dc 0 1 or
607 1
608 $ echo 72 9 div 8 mul | dc
609 64
610 </screen>
611 </para>
612 </sect1>
613
614 <sect1 id="dd">
615 <title>dd</title>
616
617 <para>
618 Usage: dd [OPTION]...
619 </para>
620
621 <para>
622 Copy a file, converting and formatting according to
623 options.
624 </para>
625
626 <para>
627 Options:
628 </para>
629
630 <para>
631 <screen>
632 if=FILE Read from FILE instead of stdin
633 of=FILE Write to FILE instead of stdout
634 bs=N Read and write N bytes at a time
635 count=N Copy only N input blocks
636 skip=N Skip N input blocks
637 seek=N Skip N output blocks
638 </screen>
639 </para>
640
641 <para>
642 Numbers may be suffixed by w (x2), k (x1024), b (x512),
643 or M (x1024^2).
644 </para>
645
646 <para>
647 Example:
648 </para>
649
650 <para>
651 <screen>
652 $ dd if=/dev/zero of=/dev/ram1 bs=1M count=4
653 4+0 records in
654 4+0 records out
655 </screen>
656 </para>
657 </sect1>
658
659 <sect1 id="deallocvt">
660 <title>deallocvt</title>
661
662 <para>
663 Usage: deallocvt N
664 </para>
665
666 <para>
667 Deallocate unused virtual terminal /dev/ttyN.
668 </para>
669 </sect1>
670
671 <sect1 id="df">
672 <title>df</title>
673
674 <para>
675 Usage: df [FILE]...
676 </para>
677
678 <para>
679 Print the filesystem space used and space available.
680 </para>
681
682 <para>
683 Example:
684 </para>
685
686 <para>
687 <screen>
688 $ df
689 Filesystem 1k-blocks Used Available Use% Mounted on
690 /dev/sda3 8690864 8553540 137324 98% /
691 /dev/sda1 64216 36364 27852 57% /boot
692 $ df /dev/sda3
693 Filesystem 1k-blocks Used Available Use% Mounted on
694 /dev/sda3 8690864 8553540 137324 98% /
695 </screen>
696 </para>
697 </sect1>
698
699 <sect1 id="dirname">
700 <title>dirname</title>
701
702 <para>
703 Usage: dirname NAME
704 </para>
705
706 <para>
707 Strip non-directory suffix from NAME.
708 </para>
709
710 <para>
711 Example:
712 </para>
713
714 <para>
715 <screen>
716 $ dirname /tmp/foo
717 /tmp
718 $ dirname /tmp/foo/
719 /tmp
720 </screen>
721 </para>
722 </sect1>
723
724 <sect1 id="dmesg">
725 <title>dmesg</title>
726
727 <para>
728 Usage: dmesg [OPTION]...
729 </para>
730
731 <para>
732 Print or control the kernel ring buffer.
733 </para>
734
735 <para>
736 Options:
737 </para>
738
739 <para>
740 <screen>
741 -c Clear the ring buffer after printing
742 -n LEVEL Set the console logging level to LEVEL
743 -s BUFSIZE Query ring buffer using a buffer of BUFSIZE
744 </screen>
745 </para>
746 </sect1>
747
Eric Andersencff3fe32000-09-20 19:22:26 +0000748 <sect1 id="dos2unix">
749 <title>dos2unix</title>
750
751 <para>
752 Usage: dos2unix < dosfile > unixfile
753 </para>
754
755 <para>
756 Converts a text file from dos format to unix format.
757 </para>
758
759 </sect1>
760
Eric Andersen6f5e2812000-07-06 16:58:45 +0000761 <sect1 id="du">
762 <title>du</title>
763
764 <para>
765 Usage: du [OPTION]... [FILE]...
766 </para>
767
768 <para>
769 Summarize the disk space used for each FILE or current
770 directory. Disk space printed in units of 1k (i.e.
771 1024 bytes).
772 </para>
773
774 <para>
775 Options:
776 </para>
777
778 <para>
779 <screen>
780 -l Count sizes many times if hard linked
781 -s Display only a total for each argument
782 </screen>
783 </para>
784
785 <para>
786 Example:
787 </para>
788
789 <para>
790 <screen>
791 $ du
792 16 ./CVS
793 12 ./kernel-patches/CVS
794 80 ./kernel-patches
795 12 ./tests/CVS
796 36 ./tests
797 12 ./scripts/CVS
798 16 ./scripts
799 12 ./docs/CVS
800 104 ./docs
801 2417 .
802 </screen>
803 </para>
804 </sect1>
805
Eric Andersen61dc0572000-07-11 17:29:36 +0000806 <sect1 id="dumpkmap">
807 <title>dumpkmap</title>
808
809 <para>
810 Usage: dumpkmap
811 </para>
812
813 <para>
814 Prints out a binary keyboard translation table to standard input.
815 </para>
Eric Andersen18a10142000-09-01 16:12:57 +0000816
817 <para>
818 Example:
819 </para>
820
821 <para>
822 <screen>
823 $ dumpkmap &lt; keymap
824 </screen>
825 </para>
Eric Andersen61dc0572000-07-11 17:29:36 +0000826 </sect1>
827
Eric Andersen6f5e2812000-07-06 16:58:45 +0000828 <sect1 id="dutmp">
829 <title>dutmp</title>
830
831 <para>
832 Usage: dutmp [FILE]
833 </para>
834
835 <para>
836 Dump utmp file format (pipe delimited) from FILE or
837 stdin to stdout.
838 </para>
839
840 <para>
841 Example:
842 </para>
843
844 <para>
845 <screen>
846 $ dutmp /var/run/utmp
847 8|7||si|||0|0|0|955637625|760097|0
848 2|0|~|~~|reboot||0|0|0|955637625|782235|0
849 1|20020|~|~~|runlevel||0|0|0|955637625|800089|0
850 8|125||l4|||0|0|0|955637629|998367|0
851 6|245|tty1|1|LOGIN||0|0|0|955637630|998974|0
852 6|246|tty2|2|LOGIN||0|0|0|955637630|999498|0
853 7|336|pts/0|vt00andersen|andersen|:0.0|0|0|0|955637763|0|0
854 </screen>
855 </para>
856 </sect1>
857
858 <sect1 id="echo">
859 <title>echo</title>
860
861 <para>
862 Usage: echo [OPTION]... [ARG]...
863 </para>
864
865 <para>
866 Print ARGs to stdout.
867 </para>
868
869 <para>
870 Options:
871 </para>
872
873 <para>
874 <screen>
875 -n Suppress trailing newline
876 -e Enable interpretation of escaped characters
877 -E Disable interpretation of escaped characters
878 </screen>
879 </para>
880
881 <para>
882 Example:
883 </para>
884
885 <para>
886 <screen>
887 $ echo "Erik is cool"
888 Erik is cool
889 $ echo -e "Erik\nis\ncool"
890 Erik
891 is
892 cool
893 $ echo "Erik\nis\ncool"
894 Erik\nis\ncool
895 </screen>
896 </para>
897 </sect1>
898
Eric Andersen1b355eb2000-09-05 17:37:48 +0000899 <sect1 id="expr">
900 <title>expr</title>
901
902 <para>
903 Usage: expr EXPRESSION
904 </para>
905
906 <para>
907 Prints the value of EXPRESSION to standard output.
908 </para>
909
910 <para>
911 EXPRESSION may be:
912 </para>
913
914 <para>
915 <screen>
916 ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2
917 ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0
918 ARG1 &lt ARG2 ARG1 is less than ARG2
919 ARG1 &lt= ARG2 ARG1 is less than or equal to ARG2
920 ARG1 = ARG2 ARG1 is equal to ARG2
921 ARG1 != ARG2 ARG1 is unequal to ARG2
922 ARG1 &gt= ARG2 ARG1 is greater than or equal to ARG2
923 ARG1 &gt ARG2 ARG1 is greater than ARG2
924 ARG1 + ARG2 arithmetic sum of ARG1 and ARG2
925 ARG1 - ARG2 arithmetic difference of ARG1 and ARG2
926 ARG1 * ARG2 arithmetic product of ARG1 and ARG2
927 ARG1 / ARG2 arithmetic quotient of ARG1 divided by ARG2
928 ARG1 % ARG2 arithmetic remainder of ARG1 divided by ARG2
929 STRING : REGEXP anchored pattern match of REGEXP in STRING
930 match STRING REGEXP same as STRING : REGEXP
931 substr STRING POS LENGTH substring of STRING, POS counted from 1
932 index STRING CHARS index in STRING where any CHARS is found, or 0
933 length STRING length of STRING
934 quote TOKEN interpret TOKEN as a string, even if it is a
935 keyword like `match' or an operator like `/'
936 ( EXPRESSION ) value of EXPRESSION
937 </screen>
938 </para>
939
940 <para>
941 Beware that many operators need to be escaped or quoted for shells.
942 Comparisons are arithmetic if both ARGs are numbers, else
943 lexicographical. Pattern matches return the string matched between
944 \( and \) or null; if \( and \) are not used, they return the number
945 of characters matched or 0.
946 </para>
947
948 </sect1>
949
950
Eric Andersen6f5e2812000-07-06 16:58:45 +0000951 <sect1 id="false">
952 <title>false</title>
953
954 <para>
955 Usage: false
956 </para>
957
958 <para>
Eric Andersen21580922000-07-07 19:07:47 +0000959 Return an exit code of FALSE (1).
Eric Andersen6f5e2812000-07-06 16:58:45 +0000960 </para>
961
962 <para>
963 Example:
964 </para>
965
966 <para>
967 <screen>
968 $ false
969 $ echo $?
970 1
971 </screen>
972 </para>
973 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +0000974
Eric Andersene5cec4e2000-07-06 19:59:22 +0000975 <sect1 id="fbset">
976 <title>fbset</title>
977
978 <para>
979 Usage: fbset [OPTION]... [MODE]
980 </para>
981
982 <para>
983 Show and modify frame buffer device settings.
984 </para>
985
986 <para>
987 Options:
988 </para>
989
990 <para>
991 <screen>
992 -h Display option summary
993 -fb DEVICE Operate on DEVICE
994 -db FILE Use FILE for mode database
995 -g XRES YRES VXRES VYRES DEPTH Set all geometry parameters
996 -t PIXCLOCK LEFT RIGHT UPPER LOWER HSLEN VSLEN Set all timing parameters
997 -xres RES Set visible horizontal resolution
998 -yres RES Set visible vertical resolution
999 </screen>
1000 </para>
1001
1002 <para>
1003 Example:
1004 </para>
1005
1006 <para>
1007 <screen>
1008 $ fbset
1009 mode "1024x768-76"
1010 # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz
1011 geometry 1024 768 1024 768 16
1012 timings 12714 128 32 16 4 128 4
1013 accel false
1014 rgba 5/11,6/5,5/0,0/0
1015 endmode
1016 </screen>
1017 </para>
1018 </sect1>
1019
1020 <sect1 id="fdflush">
1021 <title>fdflush</title>
1022
1023 <para>
1024 Usage: fdflush DEVICE
1025 </para>
1026
1027 <para>
1028 Force floppy disk drive to detect disk change on DEVICE.
1029 </para>
1030 </sect1>
1031
1032 <sect1 id="find">
1033 <title>find</title>
1034
1035 <para>
1036 Usage: find [PATH]... [EXPRESSION]
1037 </para>
1038
1039 <para>
1040 Search for files in a directory hierarchy. The default
1041 PATH is the current directory; default EXPRESSION is
1042 '-print'.
1043 </para>
1044
1045 <para>
1046 EXPRESSION may consist of:
1047 </para>
1048
1049 <para>
1050 <screen>
1051 -follow Dereference symbolic links
1052 -name PATTERN File name (leading directories removed) matches PATTERN
1053 -print Print the full file name followed by a newline to stdout
1054 </screen>
1055 </para>
1056
1057 <para>
1058 Example:
1059 </para>
1060
1061 <para>
1062 <screen>
1063 $ find / -name /etc/passwd
1064 /etc/passwd
1065 </screen>
1066 </para>
1067 </sect1>
1068
1069 <sect1 id="free">
1070 <title>free</title>
1071
1072 <para>
1073 Usage: free
1074 </para>
1075
1076 <para>
1077 Displays the amount of free and used system memory.
1078 </para>
1079
1080 <para>
1081 Example:
1082 </para>
1083
1084 <para>
1085 <screen>
1086 $ free
1087 total used free shared buffers
1088 Mem: 257628 248724 8904 59644 93124
1089 Swap: 128516 8404 120112
1090 Total: 386144 257128 129016
1091 </screen>
1092 </para>
1093 </sect1>
1094
1095 <sect1 id="freeramdisk">
1096 <title>freeramdisk</title>
1097
1098 <para>
1099 Usage: freeramdisk DEVICE
1100 </para>
1101
1102 <para>
1103 Free all memory used by the ramdisk DEVICE.
1104 </para>
1105
1106 <para>
1107 Example:
1108 </para>
1109
1110 <para>
1111 <screen>
1112 $ freeramdisk /dev/ram2
1113 </screen>
1114 </para>
1115 </sect1>
1116
1117 <sect1 id="fsck.minix">
1118 <title>fsck.minix</title>
1119
1120 <para>
1121 Usage: fsck.minix [OPTION]... DEVICE
1122 </para>
1123
1124 <para>
1125 Perform a consistency check on the MINIX filesystem on
1126 DEVICE.
1127 </para>
1128
1129 <para>
1130 Options:
1131 </para>
1132
1133 <para>
1134 <screen>
1135 -l List all filenames
1136 -r Perform interactive repairs
1137 -a Perform automatic repairs
1138 -v Verbose
1139 -s Output super-block information
1140 -m Activate MINIX-like "mode not cleared" warnings
1141 -f Force file system check.
1142 </screen>
1143 </para>
1144 </sect1>
Eric Andersena1f16bb2000-08-21 22:02:34 +00001145
1146 <sect1 id="getopt">
1147 <title>getopt</title>
1148
1149 <para>
1150 Usage: getopt [OPTIONS]...
1151 </para>
1152
1153 <para>
1154 Parse command options
1155 </para>
1156
1157 <para>
1158 <screen>
1159 -a, --alternative Allow long options starting with single -\n"
1160 -l, --longoptions=longopts Long options to be recognized\n"
1161 -n, --name=progname The name under which errors are reported\n"
1162 -o, --options=optstring Short options to be recognized\n"
1163 -q, --quiet Disable error reporting by getopt(3)\n"
1164 -Q, --quiet-output No normal output\n"
1165 -s, --shell=shell Set shell quoting conventions\n"
1166 -T, --test Test for getopt(1) version\n"
1167 -u, --unqote Do not quote the output\n"
1168 </screen>
1169 </para>
1170
1171
1172 <para>
1173 Example:
1174 </para>
1175
1176 <para>
1177 <screen>
1178 $ cat getopt.test
1179 #!/bin/sh
1180 GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \
1181 -n 'example.busybox' -- "$@"`
1182 if [ $? != 0 ] ; then exit 1 ; fi
1183 eval set -- "$GETOPT"
1184 while true ; do
1185 case $1 in
1186 -a|--a-long) echo "Option a" ; shift ;;
1187 -b|--b-long) echo "Option b, argument \`$2'" ; shift 2 ;;
1188 -c|--c-long)
1189 case "$2" in
1190 "") echo "Option c, no argument"; shift 2 ;;
1191 *) echo "Option c, argument \`$2'" ; shift 2 ;;
1192 esac ;;
1193 --) shift ; break ;;
1194 *) echo "Internal error!" ; exit 1 ;;
1195 esac
1196 done
1197 </screen>
1198 </para>
1199 </sect1>
Eric Andersene5cec4e2000-07-06 19:59:22 +00001200
1201 <sect1 id="grep">
1202 <title>grep</title>
1203
1204 <para>
1205 Usage: grep [OPTIONS]... PATTERN [FILE]...
1206 </para>
1207
1208 <para>
1209 Search for PATTERN in each FILE or stdin.
1210 </para>
1211
1212 <para>
1213 Options:
1214 </para>
1215
1216 <para>
1217 <screen>
1218 -h Suppress the prefixing filename on output
1219 -i Ignore case distinctions
1220 -n Print line number with output lines
1221 -q Be quiet. Returns 0 if result was found, 1 otherwise
1222 -v Select non-matching lines
1223 </screen>
1224 </para>
1225
1226 <para>
1227 This version of grep matches full regular expressions.
1228 </para>
1229
1230 <para>
1231 Example:
1232 </para>
1233
1234 <para>
1235 <screen>
1236 $ grep root /etc/passwd
1237 root:x:0:0:root:/root:/bin/bash
1238 $ grep ^[rR]oo. /etc/passwd
1239 root:x:0:0:root:/root:/bin/bash
1240 </screen>
1241 </para>
1242 </sect1>
1243
1244 <sect1 id="gunzip">
1245 <title>gunzip</title>
1246
1247 <para>
1248 Usage: gunzip [OPTION]... FILE
1249 </para>
1250
1251 <para>
1252 Uncompress FILE (or stdin if FILE is '-').
1253 </para>
1254
1255 <para>
1256 Options:
1257 </para>
1258
1259 <para>
1260 <screen>
1261 -c Write output to standard output
1262 -t Test compressed file integrity
1263 </screen>
1264 </para>
1265
1266 <para>
1267 Example:
1268 </para>
1269
1270 <para>
1271 <screen>
1272 $ ls -la /tmp/BusyBox*
1273 -rw-rw-r-- 1 andersen andersen 557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz
1274 $ gunzip /tmp/BusyBox-0.43.tar.gz
1275 $ ls -la /tmp/BusyBox*
1276 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1277 </screen>
1278 </para>
1279 </sect1>
1280
Pavel Roskind2d3aa32000-09-15 17:16:40 +00001281 <sect1 id="gzip">
Eric Andersene5cec4e2000-07-06 19:59:22 +00001282 <title>gzip</title>
1283
1284 <para>
1285 Usage: gzip [OPTION]... FILE
1286 </para>
1287
1288 <para>
1289 Compress FILE (or stdin if FILE is '-') with maximum
1290 compression to FILE.gz (or stdout if FILE is '-').
1291 </para>
1292
1293 <para>
1294 Options:
1295 </para>
1296
1297 <para>
1298 <screen>
1299 -c Write output to standard output
1300 </screen>
1301 </para>
1302
1303 <para>
1304 Example:
1305 </para>
1306
1307 <para>
1308 <screen>
1309 $ ls -la /tmp/BusyBox*
1310 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1311 $ gzip /tmp/BusyBox-0.43.tar
1312 $ ls -la /tmp/BusyBox*
1313 -rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/BusyBox-0.43.tar.gz
1314 </screen>
1315 </para>
1316 </sect1>
1317
1318 <sect1 id="halt">
1319 <title>halt</title>
1320
1321 <para>
1322 Usage: halt
1323 </para>
1324
1325 <para>
1326 Halt the system.
1327 </para>
1328 </sect1>
1329
1330 <sect1 id="head">
1331 <title>head</title>
1332
1333 <para>
1334 Usage: head [OPTION] FILE...
1335 </para>
1336
1337 <para>
1338 Print first 10 lines of each FILE to standard output.
1339 With more than one FILE, precede each with a header
1340 giving the file name. With no FILE, or when FILE is -,
1341 read standard input.
1342 </para>
1343
1344 <para>
1345 Options:
1346 </para>
1347
1348 <para>
1349 <screen>
1350 -n NUM Print first NUM lines instead of first 10
1351 </screen>
1352 </para>
1353
1354 <para>
1355 Example:
1356 </para>
1357
1358 <para>
1359 <screen>
1360 $ head -n 2 /etc/passwd
1361 root:x:0:0:root:/root:/bin/bash
1362 daemon:x:1:1:daemon:/usr/sbin:/bin/sh
1363 </screen>
1364 </para>
1365 </sect1>
1366
1367 <sect1 id="hostid">
1368 <title>hostid</title>
1369
1370 <para>
1371 Usage: hostid
1372 </para>
1373
1374 <para>
1375 Prints out a unique 32-bit identifier for the current
1376 machine. The 32-bit identifier is intended to be unique
1377 among all UNIX systems in existence.
1378 </para>
1379 </sect1>
1380
1381 <sect1 id="hostname">
1382 <title>hostname</title>
1383
1384 <para>
1385 Usage: hostname [OPTION]... [HOSTNAME|-F FILE]
1386 </para>
1387
1388 <para>
1389 Get or set the hostname or DNS domain name. If a
1390 hostname is given (or a file with the -F parameter), the
1391 host name will be set.
1392 </para>
1393
1394 <para>
1395 Options:
1396 </para>
1397
1398 <para>
1399 <screen>
1400 -s Short
1401 -i Addresses for the hostname
1402 -d DNS domain name
1403 -F FILE Use the contents of FILE to specify the hostname
1404 </screen>
1405 </para>
1406
1407 <para>
1408 Example:
1409 </para>
1410
1411 <para>
1412 <screen>
1413 $ hostname
1414 slag
1415 </screen>
1416 </para>
1417 </sect1>
1418
1419 <sect1 id="id">
1420 <title>id</title>
1421
1422 <para>
1423 Usage: id [OPTION]... [USERNAME]
1424 </para>
1425
1426 <para>
1427 Print information for USERNAME or the current user.
1428 </para>
1429
1430 <para>
1431 Options:
1432 </para>
1433
1434 <para>
1435 <screen>
1436 -g Print only the group ID
1437 -u Print only the user ID
1438 -r Print the real user ID instead of the effective ID (with -ug)
1439 </screen>
1440 </para>
1441
1442 <para>
1443 Example:
1444 </para>
1445
1446 <para>
1447 <screen>
1448 $ id
1449 uid=1000(andersen) gid=1000(andersen)
1450 </screen>
1451 </para>
1452 </sect1>
1453
1454 <sect1 id="init">
1455 <title>init</title>
1456
1457 <para>
1458 Usage: init
1459 </para>
1460
1461 <para>
1462 Init is the parent of all processes.
1463 </para>
1464
1465 <para>
1466 This version of init is designed to be run only by the
1467 kernel.
1468 </para>
1469
1470 <para>
1471 BusyBox init doesn't support multiple runlevels. The
1472 runlevels field of the /etc/inittab file is completely
1473 ignored by BusyBox init. If you want runlevels, use
1474 sysvinit.
1475 </para>
1476
1477 <para>
1478 BusyBox init works just fine without an inittab. If no
1479 inittab is found, it has the following default behavior:
1480 </para>
1481
1482 <para>
1483 <screen>
1484 ::sysinit:/etc/init.d/rcS
1485 ::askfirst:/bin/sh
1486 </screen>
1487 </para>
1488
1489 <para>
1490 If it detects that /dev/console is _not_ a serial
1491 console, it will also run:
1492 </para>
1493
1494 <para>
1495 <screen>
1496 tty2::askfirst:/bin/sh
1497 </screen>
1498 </para>
1499
1500 <para>
1501 If you choose to use an /etc/inittab file, the inittab
1502 entry format is as follows:
1503 </para>
1504
1505 <para>
1506 <screen>
1507 &lt;id&gt;:&lt;runlevels&gt;:&lt;action&gt;:&lt;process&gt;
1508 </screen>
Pavel Roskind2d3aa32000-09-15 17:16:40 +00001509 </para>
Eric Andersene5cec4e2000-07-06 19:59:22 +00001510
1511 <sect2>
1512 <title>id</title>
1513 <para>
1514 WARNING: This field has a non-traditional
1515 meaning for BusyBox init! The id field is used
1516 by BusyBox init to specify the controlling tty
1517 for the specified process to run on. The
1518 contents of this field are appended to "/dev/"
1519 and used as-is. There is no need for this field
1520 to be unique, although if it isn't you may have
1521 strange results. If this field is left blank,
1522 it is completely ignored. Also note that if
1523 BusyBox detects that a serial console is in use,
1524 then all entries containing non-empty id fields
1525 will _not_ be run. BusyBox init does nothing
1526 with utmp. We don't need no stinkin' utmp.
1527 </para>
1528 </sect2>
1529
1530 <sect2>
1531 <title>runlevels</title>
1532
1533 <para>
1534 The runlevels field is completely ignored.
1535 </para>
1536 </sect2>
1537
1538 <sect2>
1539 <title>action</title>
1540
1541 <para>
1542 Valid actions include: sysinit, respawn,
1543 askfirst, wait, once, and ctrlaltdel.
1544 </para>
1545
1546 <para>
1547 askfirst acts just like respawn, but before
1548 running the specified process it displays the
1549 line "Please press Enter to activate this
1550 console." and then waits for the user to press
1551 enter before starting the specified process.
1552 </para>
1553
1554 <para>
1555 Unrecognized actions (like initdefault) will
1556 cause init to emit an error message, and then go
1557 along with its business.
1558 </para>
1559 </sect2>
1560
1561 <sect2>
1562 <title>process</title>
1563
1564 <para>
1565 Specifies the process to be executed and its
1566 command line.
1567 </para>
1568 </sect2>
1569
Pavel Roskind2d3aa32000-09-15 17:16:40 +00001570 <sect2>
1571 <title>Example /etc/inittab file</title>
Eric Andersene5cec4e2000-07-06 19:59:22 +00001572
Eric Andersen57f83ff2000-09-24 02:41:44 +00001573 <para>
1574 <screen>
1575 # This is run first except when booting in single-user mode.
1576 #
1577 ::sysinit:/etc/init.d/rcS
Eric Andersene5cec4e2000-07-06 19:59:22 +00001578
Eric Andersen57f83ff2000-09-24 02:41:44 +00001579 # /bin/sh invocations on selected ttys
1580 #
1581 # Start an "askfirst" shell on the console (whatever that may be)
1582 ::askfirst:-/bin/sh
1583 # Start an "askfirst" shell on /dev/tty2-4
1584 tty2::askfirst:-/bin/sh
1585 tty2::askfirst:-/bin/sh
1586 tty2::askfirst:-/bin/sh
Eric Andersene5cec4e2000-07-06 19:59:22 +00001587
Eric Andersen57f83ff2000-09-24 02:41:44 +00001588 # /sbin/getty invocations for selected ttys
1589 #
1590 tty4::respawn:/sbin/getty 38400 tty5
1591 tty5::respawn:/sbin/getty 38400 tty6
Eric Andersene5cec4e2000-07-06 19:59:22 +00001592
Eric Andersen57f83ff2000-09-24 02:41:44 +00001593 # Example of how to put a getty on a serial line (for a terminal)
1594 #
1595 #ttyS0::respawn:/sbin/getty -L ttyS0 9600 vt100
1596 #ttyS1::respawn:/sbin/getty -L ttyS1 9600 vt100
1597 #
1598 # Example how to put a getty on a modem line.
1599 #ttyS2::respawn:/sbin/getty -x0 -s 57600 ttyS2
Eric Andersene5cec4e2000-07-06 19:59:22 +00001600
Eric Andersen57f83ff2000-09-24 02:41:44 +00001601 # Stuff to do before rebooting
1602 ::ctrlaltdel:/bin/umount -a -r
1603 ::ctrlaltdel:/sbin/swapoff
1604 </screen>
1605 </para>
Pavel Roskind2d3aa32000-09-15 17:16:40 +00001606 </sect2>
Eric Andersene5cec4e2000-07-06 19:59:22 +00001607 </sect1>
1608
1609 <sect1 id="insmod">
1610 <title>insmod</title>
1611
1612 <para>
1613 Usage: insmod [OPTION]... MODULE [symbol=value]...
1614 </para>
1615
1616 <para>
Eric Andersen21580922000-07-07 19:07:47 +00001617 Load MODULE into the kernel.
Eric Andersene5cec4e2000-07-06 19:59:22 +00001618 </para>
1619
1620 <para>
1621 Options:
1622 </para>
1623
1624 <para>
1625 <screen>
1626 -f Force module to load into the wrong kernel version.
1627 -k Make module autoclean-able.
1628 -v Verbose output
1629 -x Do not export externs
1630 </screen>
1631 </para>
1632 </sect1>
1633
1634 <sect1 id="kill">
1635 <title>kill</title>
1636
1637 <para>
1638 Usage: kill [OPTION] PID...
1639 </para>
1640
1641 <para>
1642 Send a signal (default is SIGTERM) to the specified
1643 PID(s).
1644 </para>
1645
1646 <para>
1647 Options:
1648 </para>
1649
1650 <para>
1651 <screen>
1652 -l List all signal names and numbers
1653 -SIG Send signal SIG
1654 </screen>
1655 </para>
1656
1657 <para>
1658 Example:
1659 </para>
1660
1661 <para>
1662 <screen>
1663 $ ps | grep apache
1664 252 root root S [apache]
1665 263 www-data www-data S [apache]
1666 264 www-data www-data S [apache]
1667 265 www-data www-data S [apache]
1668 266 www-data www-data S [apache]
1669 267 www-data www-data S [apache]
1670 $ kill 252
1671 </screen>
1672 </para>
1673 </sect1>
1674
1675 <sect1 id="killall">
1676 <title>killall</title>
1677
1678 <para>
1679 Usage: killall [OPTION] NAME...
1680 </para>
1681
1682 <para>
1683 Send a signal (default is SIGTERM) to the specified
1684 NAME(s).
1685 </para>
1686
1687 <para>
1688 Options:
1689 </para>
1690
1691 <para>
1692 <screen>
1693 -l List all signal names and numbers
1694 -SIG Send signal SIG
1695 </screen>
1696 </para>
1697
1698 <para>
1699 Example:
1700 </para>
1701
1702 <para>
1703 <screen>
1704 $ killall apache
1705 </screen>
1706 </para>
1707 </sect1>
1708
1709 <sect1 id="length">
1710 <title>length</title>
1711
1712 <para>
1713 Usage: length STRING
1714 </para>
1715
1716 <para>
1717 Print the length of STRING.
1718 </para>
1719
1720 <para>
1721 Example:
1722 </para>
1723
1724 <para>
1725 <screen>
1726 $ length "Hello"
1727 5
1728 </screen>
1729 </para>
1730 </sect1>
1731
1732 <sect1 id="ln">
1733 <title>ln</title>
1734
1735 <para>
1736 Usage: ln [OPTION]... TARGET FILE|DIRECTORY
1737 </para>
1738
1739 <para>
1740 Create a link named FILE or DIRECTORY to the specified
1741 TARGET. You may use '--' to indicate that all following
1742 arguments are non-options.
1743 </para>
1744
1745 <para>
1746 Options:
1747 </para>
1748
1749 <para>
1750 <screen>
1751 -s Make symbolic link instead of hard link
1752 -f Remove existing destination file
1753 </screen>
1754 </para>
1755
1756 <para>
1757 Example:
1758 </para>
1759
1760 <para>
1761 <screen>
1762 $ ln -s BusyBox /tmp/ls
1763 $ ls -l /tmp/ls
1764 lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -&gt; BusyBox*
1765 </screen>
1766 </para>
1767 </sect1>
1768
1769 <sect1 id="loadacm">
1770 <title>loadacm</title>
1771
1772 <para>
1773 Usage: loadacm
1774 </para>
1775
1776 <para>
1777 Load an acm from stdin.
1778 </para>
1779
1780 <para>
1781 Example:
1782 </para>
1783
1784 <para>
1785 <screen>
1786 $ loadacm &lt; /etc/i18n/acmname
1787 </screen>
1788 </para>
1789 </sect1>
1790
1791 <sect1 id="loadfont">
1792 <title>loadfont</title>
1793
1794 <para>
1795 Usage: loadfont
1796 </para>
1797
1798 <para>
1799 Load a console font from stdin.
1800 </para>
1801
1802 <para>
1803 Example:
1804 </para>
1805
1806 <para>
1807 <screen>
1808 $ loadfont &lt; /etc/i18n/fontname
1809 </screen>
1810 </para>
1811 </sect1>
1812
1813 <sect1 id="loadkmap">
1814 <title>loadkmap</title>
1815
1816 <para>
1817 Usage: loadkmap
1818 </para>
1819
1820 <para>
1821 Load a binary keyboard translation table from stdin.
1822 </para>
1823
1824 <para>
1825 Example:
1826 </para>
1827
1828 <para>
1829 <screen>
1830 $ loadkmap &lt; /etc/i18n/lang-keymap
1831 </screen>
1832 </para>
1833 </sect1>
1834
1835 <sect1 id="logger">
1836 <title>logger</title>
1837
1838 <para>
1839 Usage: logger [OPTION]... [MESSAGE]
1840 </para>
1841
1842 <para>
1843 Write MESSAGE to the system log. If MESSAGE is '-', log
1844 stdin.
1845 </para>
1846
1847 <para>
1848 Options:
1849 </para>
1850
1851 <para>
1852 <screen>
1853 -s Log to stderr as well as the system log
1854 -t Log using the specified tag (defaults to user name)
1855 -p Enter the message with the specified priority
1856 This may be numerical or a ``facility.level'' pair
1857 </screen>
1858 </para>
1859
1860 <para>
1861 Example:
1862 </para>
1863
1864 <para>
1865 <screen>
1866 $ logger "hello"
1867 </screen>
1868 </para>
1869 </sect1>
1870
1871 <sect1 id="logname">
1872 <title>logname</title>
1873
1874 <para>
1875 Usage: logname
1876 </para>
1877
1878 <para>
1879 Print the name of the current user.
1880 </para>
1881
1882 <para>
1883 Example:
1884 </para>
1885
1886 <para>
1887 <screen>
1888 $ logname
1889 root
1890 </screen>
1891 </para>
1892 </sect1>
1893
1894 <sect1 id="ls">
1895 <title>ls</title>
1896
1897 <para>
1898 Usage: ls [OPTION]... [FILE]...
1899 </para>
1900
1901 <para>
1902
1903 </para>
1904
1905 <para>
1906 Options:
1907 </para>
1908
1909 <para>
1910 <screen>
1911 -a Do not hide entries starting with .
1912 -c With -l: show ctime (the time of last
1913 modification of file status information)
1914 -d List directory entries instead of contents
1915 -e List both full date and full time
1916 -l Use a long listing format
1917 -n List numeric UIDs and GIDs instead of names
1918 -p Append indicator (one of /=@|) to entries
1919 -u With -l: show access time (the time of last
1920 access of the file)
1921 -x List entries by lines instead of by columns
1922 -A Do not list implied . and ..
1923 -C List entries by columns
1924 -F Append indicator (one of */=@|) to entries
Eric Andersen5b176932000-09-22 20:22:28 +00001925 -L list entries pointed to by symbolic links
Eric Andersene5cec4e2000-07-06 19:59:22 +00001926 -R List subdirectories recursively
1927 </screen>
1928 </para>
1929
1930 <para>
1931 Example:
1932 </para>
1933
1934 <para>
1935 <screen>
1936 </screen>
1937 </para>
1938 </sect1>
1939
1940 <sect1 id="lsmod">
1941 <title>lsmod</title>
1942
1943 <para>
1944 Usage: lsmod
1945 </para>
1946
1947 <para>
1948 List currently loaded kernel modules.
1949 </para>
1950 </sect1>
1951
1952 <sect1 id="makedevs">
1953 <title>makedevs</title>
1954
1955 <para>
1956 Usage: makedevsf NAME TYPE MAJOR MINOR FIRST LAST [s]
1957 </para>
1958
1959 <para>
1960 Create a range of block or character special files.
1961 </para>
1962
1963 <para>
1964 TYPE may be:
1965 </para>
1966
1967 <para>
1968 <screen>
1969 b Make a block (buffered) device
1970 c or u Make a character (un-buffered) device
1971 p Make a named pipe. MAJOR and MINOR are ignored for named pipes
1972 </screen>
1973 </para>
1974
1975 <para>
1976 FIRST specifies the number appended to NAME to create
1977 the first device. LAST specifies the number of the last
1978 item that should be created. If 's' is the last
1979 argument, the base device is created as well.
1980 </para>
1981
1982 <para>
1983 Example:
1984 </para>
1985
1986 <para>
1987 <screen>
1988 $ makedevs /dev/ttyS c 4 66 2 63
1989 [creates ttyS2-ttyS63]
1990 $ makedevs /dev/hda b 3 0 0 8 s
1991 [creates hda,hda1-hda8]
1992 </screen>
1993 </para>
1994 </sect1>
1995
Eric Andersenb9eb0232000-07-07 05:04:24 +00001996 <sect1 id="md5sum">
1997 <title>md5sum</title>
1998
1999 <para>
2000 Usage: md5sum [OPTION]... FILE...
2001 </para>
2002
2003 <para>
2004 Print or check MD5 checksums.
2005 </para>
2006
2007 <para>
2008 Options:
2009 </para>
2010
2011 <para>
2012 <screen>
2013 -b Read files in binary mode
2014 -c Check MD5 sums against given list
2015 -t Read files in text mode (default)
2016 -g Read a string
2017 </screen>
2018 </para>
2019
2020 <para>
2021 The following two options are useful only when verifying
2022 checksums:
2023 </para>
2024
2025 <para>
2026 <screen>
2027 -s Don't output anything, status code shows success
2028 -w Warn about improperly formated MD5 checksum lines
2029 </screen>
2030 </para>
2031
2032 <para>
2033 Example:
2034 </para>
2035
2036 <para>
2037 <screen>
2038 $ md5sum busybox
2039 6fd11e98b98a58f64ff3398d7b324003 busybox
2040 $ md5sum -c
2041 6fd11e98b98a58f64ff3398d7b324003 busybox
2042 6fd11e98b98a58f64ff3398d7b324002 busybox
2043 md5sum: MD5 check failed for 'busybox'
2044 ^D
2045 </screen>
2046 </para>
2047 </sect1>
2048
2049 <sect1 id="mkdir">
2050 <title>mkdir</title>
2051
2052 <para>
2053 Usage: mkdir [OPTION]... DIRECTORY...
2054 </para>
2055
2056 <para>
2057 Create the DIRECTORY(s), if they do not already exist.
2058 </para>
2059
2060 <para>
2061 Options:
2062 </para>
2063
2064 <para>
2065 <screen>
2066 -m Set permission mode (as in chmod), not rwxrwxrwx - umask
2067 -p No error if directory exists, make parent directories as needed
2068 </screen>
2069 </para>
2070
2071 <para>
2072 Example:
2073 </para>
2074
2075 <para>
2076 <screen>
2077 $ mkdir /tmp/foo
2078 $ mkdir /tmp/foo
2079 /tmp/foo: File exists
2080 $ mkdir /tmp/foo/bar/baz
2081 /tmp/foo/bar/baz: No such file or directory
2082 $ mkdir -p /tmp/foo/bar/baz
2083 </screen>
2084 </para>
2085 </sect1>
2086
2087 <sect1 id="mkfifo">
2088 <title>mkfifo</title>
2089
2090 <para>
2091 Usage: mkfifo [OPTION] NAME
2092 </para>
2093
2094 <para>
2095 Create a named pipe (identical to 'mknod NAME p').
2096 </para>
2097
2098 <para>
2099 Options:
2100 </para>
2101
2102 <para>
2103 <screen>
2104 -m MODE Create the pipe using the specified mode (default a=rw)
2105 </screen>
2106 </para>
2107 </sect1>
2108
2109 <sect1 id="mkfs.minix">
2110 <title>mkfs.minix</title>
2111
2112 <para>
2113 Usage: mkfs.minix [OPTION]... NAME [BLOCKS]
2114 </para>
2115
2116 <para>
2117 Make a MINIX filesystem.
2118 </para>
2119
2120 <para>
2121 Options:
2122 </para>
2123
2124 <para>
2125 <screen>
2126 -c Check the device for bad blocks
2127 -n [14|30] Specify the maximum length of filenames
2128 -i Specify the number of inodes for the filesystem
2129 -l FILENAME Read the bad blocks list from FILENAME
2130 -v Make a Minix version 2 filesystem
2131 </screen>
2132 </para>
2133 </sect1>
2134
2135 <sect1 id="mknod">
2136 <title>mknod</title>
2137
2138 <para>
2139 Usage: mknod [OPTION]... NAME TYPE MAJOR MINOR
2140 </para>
2141
2142 <para>
2143 Create a special file (block, character, or pipe).
2144 </para>
2145
2146 <para>
2147 Options:
2148 </para>
2149
2150 <para>
2151 <screen>
2152 -m Create the special file using the specified mode (default a=rw)
2153 </screen>
2154 </para>
2155
2156 <para>
2157 TYPE may be:
2158 </para>
2159
2160 <para>
2161 <screen>
2162 b Make a block (buffered) device
2163 c or u Make a character (un-buffered) device
2164 p Make a named pipe. MAJOR and MINOR are ignored for named pipes
2165 </screen>
2166 </para>
2167
2168 <para>
2169 Example:
2170 </para>
2171
2172 <para>
2173 <screen>
2174 $ mknod /dev/fd0 b 2 0
2175 $ mknod -m 644 /tmp/pipe p
2176 </screen>
2177 </para>
2178 </sect1>
2179
2180 <sect1 id="mkswap">
2181 <title>mkswap</title>
2182
2183 <para>
2184 Usage: mkswap [OPTION]... DEVICE [BLOCKS]
2185 </para>
2186
2187 <para>
2188 Prepare a disk partition to be used as a swap partition.
2189 </para>
2190
2191 <para>
2192 Options:
2193 </para>
2194
2195 <para>
2196 <screen>
2197 -c Check for read-ability.
2198 -v0 Make version 0 swap [max 128 Megs].
2199 -v1 Make version 1 swap [big!] (default for kernels &gt; 2.1.117).
2200 BLOCKS Number of block to use (default is entire partition).
2201 </screen>
2202 </para>
2203 </sect1>
2204
2205 <sect1 id="mktemp">
2206 <title>mktemp</title>
2207
2208 <para>
2209 Usage: mktemp TEMPLATE
2210 </para>
2211
2212 <para>
2213 Creates a temporary file with its name based on
2214 TEMPLATE. TEMPLATE is any name with six `Xs' (i.e.
2215 /tmp/temp.XXXXXX).
2216 </para>
2217
2218 <para>
2219 Example:
2220 </para>
2221
2222 <para>
2223 <screen>
2224 $ mktemp /tmp/temp.XXXXXX
2225 /tmp/temp.mWiLjM
2226 $ ls -la /tmp/temp.mWiLjM
2227 -rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM
2228 </screen>
2229 </para>
2230 </sect1>
2231
2232 <sect1 id="more">
2233 <title>more</title>
2234
2235 <para>
2236 Usage: more [FILE]...
2237 </para>
2238
2239 <para>
2240 Page through text one screenful at a time.
2241 </para>
2242
2243 <para>
2244 Example:
2245 </para>
2246
2247 <para>
2248 <screen>
2249 $ dmesg | more
2250 </screen>
2251 </para>
2252 </sect1>
2253
2254 <sect1 id="mount">
2255 <title>mount</title>
2256
2257 <para>
2258 Usage: mount [OPTION]...
2259 </para>
2260
2261 <para>
2262 <screen>
2263 or: mount [OPTION]... DEVICE DIRECTORY
2264 </screen>
2265 </para>
2266
2267 <para>
2268 Mount filesystems.
2269 </para>
2270
2271 <para>
2272 Options:
2273 </para>
2274
2275 <para>
2276 <screen>
2277 -a Mount all filesystems in /etc/fstab
2278 -o One of the many filesystem options listed below
2279 -r Mount the filesystem read-only
2280 -t TYPE Specify the filesystem type
2281 -w Mount the filesystem read-write
2282 </screen>
2283 </para>
2284
2285 <para>
2286 Options for use with the -o flag:
2287 </para>
2288
2289 <para>
2290 <screen>
2291 async/sync Writes are asynchronous / synchronous
2292 atime/noatime Enable / disable updates to inode access times
2293 dev/nodev Allow / disallow use of special device files
2294 exec/noexec Allow / disallow use of executable files
2295 loop Mount a file via loop device
2296 suid/nosuid Allow / disallow set-user-id-root programs
2297 remount Remount a currently mounted filesystem
2298 ro/rw Mount filesystem read-only / read-write
2299 </screen>
2300 </para>
2301
2302 <para>
2303 There are even more flags that are filesystem specific.
2304 You'll have to see the written documentation for those.
2305 </para>
2306
2307 <para>
2308 Example:
2309 </para>
2310
2311 <para>
2312 <screen>
2313 $ mount
2314 /dev/hda3 on / type minix (rw)
2315 proc on /proc type proc (rw)
2316 devpts on /dev/pts type devpts (rw)
2317 $ mount /dev/fd0 /mnt -t msdos -o ro
2318 $ mount /tmp/diskimage /opt -t ext2 -o loop
2319 </screen>
2320 </para>
2321 </sect1>
2322
2323 <sect1 id="mt">
2324 <title>mt</title>
2325
2326 <para>
2327 Usage: mt [OPTION] OPCODE VALUE
2328 </para>
2329
2330 <para>
2331 Control magnetic tape drive operation.
2332 </para>
2333
2334 <para>
2335 Options:
2336 </para>
2337
2338 <para>
2339 <screen>
2340 -f DEVICE Control DEVICE
2341 </screen>
2342 </para>
2343 </sect1>
2344
2345 <sect1 id="mv">
2346 <title>mv</title>
2347
2348 <para>
2349 Usage: mv SOURCE DEST
2350 </para>
2351
2352 <para>
2353 <screen>
2354 or: mv SOURCE... DIRECTORY
2355 </screen>
2356 </para>
2357
2358 <para>
2359 Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
2360 </para>
2361
2362 <para>
2363 Example:
2364 </para>
2365
2366 <para>
2367 <screen>
2368 $ mv /tmp/foo /bin/bar
2369 </screen>
2370 </para>
2371 </sect1>
2372
2373 <sect1 id="nc">
2374 <title>nc</title>
2375
2376 <para>
2377 Usage: nc HOST PORT
2378 </para>
2379
2380 <para>
2381 Open a pipe to HOST:PORT.
2382 </para>
2383
2384 <para>
2385 Example:
2386 </para>
2387
2388 <para>
2389 <screen>
2390 $ nc foobar.somedomain.com 25
2391 220 foobar ESMTP Exim 3.12 #1 Sat, 15 Apr 2000 00:03:02 -0600
2392 help
2393 214-Commands supported:
2394 214- HELO EHLO MAIL RCPT DATA AUTH
2395 214 NOOP QUIT RSET HELP
2396 quit
2397 221 foobar closing connection
2398 </screen>
2399 </para>
2400 </sect1>
2401
2402 <sect1 id="nslookup">
2403 <title>nslookup</title>
2404
2405 <para>
2406 Usage: nslookup [HOST]
2407 </para>
2408
2409 <para>
2410 Query the nameserver for the IP address of the given
2411 HOST.
2412 </para>
2413
2414 <para>
2415 Example:
2416 </para>
2417
2418 <para>
2419 <screen>
2420 $ nslookup localhost
2421 Server: default
2422 Address: default
2423
2424 Name: debian
2425 Address: 127.0.0.1
2426 </screen>
2427 </para>
2428 </sect1>
2429
2430 <sect1 id="ping">
2431 <title>ping</title>
2432
2433 <para>
2434 Usage: ping [OPTION]... HOST
2435 </para>
2436
2437 <para>
2438 Send ICMP ECHO_REQUEST packets to HOST.
2439 </para>
2440
2441 <para>
2442 Options:
2443 </para>
2444
2445 <para>
2446 <screen>
2447 -c COUNT Send only COUNT pings
2448 -s SIZE Send SIZE data bytes in packets (default=56)
2449 -q Quiet mode, only displays output at start and when finished
2450 </screen>
2451 </para>
2452
2453 <para>
2454 Example:
2455 </para>
2456
2457 <para>
2458 <screen>
2459 $ ping localhost
2460 PING slag (127.0.0.1): 56 data bytes
2461 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=20.1 ms
2462
2463 --- debian ping statistics ---
2464 1 packets transmitted, 1 packets received, 0% packet loss
2465 round-trip min/avg/max = 20.1/20.1/20.1 ms
2466 </screen>
2467 </para>
2468 </sect1>
2469
2470 <sect1 id="poweroff">
2471 <title>poweroff</title>
2472
2473 <para>
2474 Usage: poweroff
2475 </para>
2476
2477 <para>
2478 Shut down the system, and request that the kernel turn
2479 off power upon halting.
2480 </para>
2481 </sect1>
2482
2483 <sect1 id="printf">
2484 <title>printf</title>
2485
2486 <para>
2487 Usage: printf FORMAT [ARGUMENT]...
2488 </para>
2489
2490 <para>
2491 Format and print the given data in a manner similar to
2492 the C printf command.
2493 </para>
2494
2495 <para>
2496 Example:
2497 </para>
2498
2499 <para>
2500 <screen>
2501 $ printf "Val=%d\n" 5
2502 Val=5
2503 </screen>
2504 </para>
2505 </sect1>
2506
Eric Andersen21580922000-07-07 19:07:47 +00002507 <sect1 id="ps">
2508 <title>ps</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002509
Eric Andersen21580922000-07-07 19:07:47 +00002510 <para>
2511 Usage: ps
2512 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002513
Eric Andersen21580922000-07-07 19:07:47 +00002514 <para>
2515 Report process status. This version of ps accepts no
2516 options.
2517 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002518
Eric Andersen21580922000-07-07 19:07:47 +00002519 <para>
2520 Options:
2521 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002522
Eric Andersen21580922000-07-07 19:07:47 +00002523 <para>
2524 <screen>
2525 </screen>
2526 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002527
Eric Andersen21580922000-07-07 19:07:47 +00002528 <para>
2529 Example:
2530 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002531
Eric Andersen21580922000-07-07 19:07:47 +00002532 <para>
2533 <screen>
2534 $ ps
2535 PID Uid Gid State Command
2536 1 root root S init
2537 2 root root S [kflushd]
2538 3 root root S [kupdate]
2539 4 root root S [kpiod]
2540 5 root root S [kswapd]
2541 742 andersen andersen S [bash]
2542 743 andersen andersen S -bash
2543 745 root root S [getty]
2544 2990 andersen andersen R ps
2545 </screen>
2546 </para>
2547 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002548
Eric Andersen21580922000-07-07 19:07:47 +00002549 <sect1 id="pwd">
2550 <title>pwd</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002551
Eric Andersen21580922000-07-07 19:07:47 +00002552 <para>
2553 Usage: pwd
2554 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002555
Eric Andersen21580922000-07-07 19:07:47 +00002556 <para>
2557 Print the full filename of the current working
2558 directory.
2559 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002560
Eric Andersen21580922000-07-07 19:07:47 +00002561 <para>
2562 Example:
2563 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002564
Eric Andersen21580922000-07-07 19:07:47 +00002565 <para>
2566 <screen>
2567 $ pwd
2568 /root
2569 </screen>
2570 </para>
2571 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002572
Eric Andersen918507e2000-08-21 22:46:33 +00002573 <sect1 id="rdate">
2574 <title>rdate</title>
2575
2576 <para>
2577 Usage: rdate [OPTION] HOST
2578 </para>
2579
2580 <para>
2581 Get and possibly set the system date and time from a remote HOST.
2582 </para>
2583
2584 <para>
2585 Options:
2586 </para>
2587
2588 <para>
2589 <screen>
2590 -s Set the system date and time (default).
2591 -p Print the date and time.
2592 </screen>
2593 </para>
2594 </sect1>
2595
Eric Andersen21580922000-07-07 19:07:47 +00002596 <sect1 id="reboot">
2597 <title>reboot</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002598
Eric Andersen21580922000-07-07 19:07:47 +00002599 <para>
2600 Usage: reboot
2601 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002602
Eric Andersen21580922000-07-07 19:07:47 +00002603 <para>
2604 Reboot the system.
2605 </para>
2606 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002607
Eric Andersenbf960f52000-07-21 21:32:12 +00002608 <sect1 id="renice">
2609 <title>renice</title>
2610
2611 <para>
2612 Usage: renice priority pid [pid ...]
2613 </para>
2614
2615 <para>
2616 Changes priority of running processes. Allowed priorities range
2617 from 20 (the process runs only when nothing else is running) to 0
2618 (default priority) to -20 (almost nothing else ever gets to run).
2619 </para>
2620 </sect1>
2621
Eric Andersenfa405d02000-08-21 21:18:52 +00002622 <sect1 id="reset">
2623 <title>reset</title>
2624
2625 <para>
2626 Usage: reset
2627 </para>
2628
2629 <para>
2630 Resets the screen.
2631 </para>
2632 </sect1>
2633
Eric Andersen21580922000-07-07 19:07:47 +00002634 <sect1 id="rm">
2635 <title>rm</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002636
Eric Andersen21580922000-07-07 19:07:47 +00002637 <para>
2638 Usage: rm [OPTION]... FILE...
2639 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002640
Eric Andersen21580922000-07-07 19:07:47 +00002641 <para>
2642 Remove (unlink) the FILE(s). You may use '--' to
2643 indicate that all following arguments are non-options.
2644 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002645
Eric Andersen21580922000-07-07 19:07:47 +00002646 <para>
2647 Options:
2648 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002649
Eric Andersen21580922000-07-07 19:07:47 +00002650 <para>
2651 <screen>
2652 -f Remove existing destinations, never prompt
2653 -r or -R Remove the contents of directories recursively
2654 </screen>
2655 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002656
Eric Andersen21580922000-07-07 19:07:47 +00002657 <para>
2658 Example:
2659 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002660
Eric Andersen21580922000-07-07 19:07:47 +00002661 <para>
2662 <screen>
2663 $ rm -rf /tmp/foo
2664 </screen>
2665 </para>
2666 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002667
Eric Andersen21580922000-07-07 19:07:47 +00002668 <sect1 id="rmdir">
2669 <title>rmdir</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002670
Eric Andersen21580922000-07-07 19:07:47 +00002671 <para>
2672 Usage: rmdir DIRECTORY...
2673 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002674
Eric Andersen21580922000-07-07 19:07:47 +00002675 <para>
2676 Remove DIRECTORY(s) if they are empty.
2677 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002678
Eric Andersen21580922000-07-07 19:07:47 +00002679 <para>
2680 Example:
2681 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002682
Eric Andersen21580922000-07-07 19:07:47 +00002683 <para>
2684 <screen>
2685 $ rmdir /tmp/foo
2686 </screen>
2687 </para>
2688 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002689
Eric Andersen21580922000-07-07 19:07:47 +00002690 <sect1 id="rmmod">
2691 <title>rmmod</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002692
Eric Andersen21580922000-07-07 19:07:47 +00002693 <para>
2694 Usage: rmmod [OPTION]... [MODULE]...
2695 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002696
Eric Andersen21580922000-07-07 19:07:47 +00002697 <para>
2698 Unload MODULE(s) from the kernel.
2699 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002700
Eric Andersen21580922000-07-07 19:07:47 +00002701 <para>
2702 Options:
2703 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002704
Eric Andersen21580922000-07-07 19:07:47 +00002705 <para>
2706 <screen>
2707 -a Try to remove all unused kernel modules
2708 </screen>
2709 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002710
Eric Andersen21580922000-07-07 19:07:47 +00002711 <para>
2712 Example:
2713 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002714
Eric Andersen21580922000-07-07 19:07:47 +00002715 <para>
2716 <screen>
2717 $ rmmod tulip
2718 </screen>
2719 </para>
2720 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002721
Eric Andersen21580922000-07-07 19:07:47 +00002722 <sect1 id="sed">
2723 <title>sed</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002724
Eric Andersen21580922000-07-07 19:07:47 +00002725 <para>
2726 Usage: sed [OPTION]... SCRIPT [FILE]...
2727 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002728
Eric Andersen21580922000-07-07 19:07:47 +00002729 <para>
2730 Allowed sed scripts come in the following form:
2731 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002732
Eric Andersen21580922000-07-07 19:07:47 +00002733 <para>
2734 <screen>
2735 ADDR [!] COMMAND
2736 </screen>
2737 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002738
Eric Andersen21580922000-07-07 19:07:47 +00002739 <para>
2740 ADDR can be:
2741 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002742
Eric Andersen21580922000-07-07 19:07:47 +00002743 <para>
2744 <screen>
2745 NUMBER Match specified line number
2746 $ Match last line
2747 /REGEXP/ Match specified regexp
2748 </screen>
2749 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002750
Eric Andersen21580922000-07-07 19:07:47 +00002751 <para>
2752 ! inverts the meaning of the match
2753 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002754
Eric Andersen21580922000-07-07 19:07:47 +00002755 <para>
2756 COMMAND can be:
2757 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002758
Eric Andersen21580922000-07-07 19:07:47 +00002759 <para>
2760 <screen>
2761 s/regexp/replacement/[igp]
2762 which attempt to match regexp against the pattern space
2763 and if successful replaces the matched portion with replacement.
2764 aTEXT
2765 which appends TEXT after the pattern space
2766 </screen>
2767 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002768
Eric Andersen21580922000-07-07 19:07:47 +00002769 <para>
2770 This version of sed matches full regular expressions.
2771 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002772
Eric Andersen21580922000-07-07 19:07:47 +00002773 <para>
2774 Options:
2775 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002776
Eric Andersen21580922000-07-07 19:07:47 +00002777 <para>
2778 <screen>
2779 -e Add the script to the commands to be executed
2780 -n Suppress automatic printing of pattern space
2781 </screen>
2782 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002783
Eric Andersen21580922000-07-07 19:07:47 +00002784 <para>
2785 Example:
2786 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002787
Eric Andersen21580922000-07-07 19:07:47 +00002788 <para>
2789 <screen>
2790 $ echo "foo" | sed -e 's/f[a-zA-Z]o/bar/g'
2791 bar
2792 </screen>
2793 </para>
2794 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002795
Eric Andersen21580922000-07-07 19:07:47 +00002796 <sect1 id="setkeycodes">
2797 <title>setkeycodes</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002798
Eric Andersen21580922000-07-07 19:07:47 +00002799 <para>
2800 Usage: setkeycodes SCANCODE KEYCODE ...
2801 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002802
Eric Andersen21580922000-07-07 19:07:47 +00002803 <para>
2804 Set entries into the kernel's scancode-to-keycode map,
2805 allowing unusual keyboards to generate usable keycodes.
2806 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002807
Eric Andersen21580922000-07-07 19:07:47 +00002808 <para>
2809 SCANCODE may be either xx or e0xx (hexadecimal), and
2810 KEYCODE is given in decimal.
2811 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002812
Eric Andersen21580922000-07-07 19:07:47 +00002813 <para>
2814 Example:
2815 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002816
Eric Andersen21580922000-07-07 19:07:47 +00002817 <para>
2818 <screen>
2819 $ setkeycodes e030 127
2820 </screen>
2821 </para>
2822 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002823
Mark Whitley83a949c2000-06-26 13:31:53 +00002824
Eric Andersen21580922000-07-07 19:07:47 +00002825 <sect1 id="sh">
2826 <title>sh</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002827
Eric Andersen21580922000-07-07 19:07:47 +00002828 <para>
2829 Usage: sh
2830 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002831
Eric Andersen21580922000-07-07 19:07:47 +00002832 <para>
2833 lash -- the BusyBox LAme SHell (command interpreter)
2834 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002835
Eric Andersen21580922000-07-07 19:07:47 +00002836 <para>
2837 This command does not yet have proper documentation.
2838 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002839
Eric Andersen21580922000-07-07 19:07:47 +00002840 <para>
2841 Use lash just as you would use any other shell. It
2842 properly handles pipes, redirects, job control, can be
2843 used as the shell for scripts (#!/bin/sh), and has a
2844 sufficient set of builtins to do what is needed. It does
2845 not (yet) support Bourne Shell syntax. If you need
2846 things like ``if-then-else'', ``while'', and such, use
2847 ash or bash. If you just need a very simple and
2848 extremely small shell, this will do the job.
2849 </para>
2850 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002851
Eric Andersen21580922000-07-07 19:07:47 +00002852 <sect1 id="sleep">
2853 <title>sleep</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002854
Eric Andersen21580922000-07-07 19:07:47 +00002855 <para>
2856 Usage: sleep N
2857 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002858
Eric Andersen21580922000-07-07 19:07:47 +00002859 <para>
2860 Pause for N seconds.
2861 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002862
Eric Andersen21580922000-07-07 19:07:47 +00002863 <para>
2864 Example:
2865 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002866
Eric Andersen21580922000-07-07 19:07:47 +00002867 <para>
2868 <screen>
2869 $ sleep 2
2870 [2 second delay results]
2871 </screen>
2872 </para>
2873 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002874
Eric Andersen21580922000-07-07 19:07:47 +00002875 <sect1 id="sort">
2876 <title>sort</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002877
Eric Andersen21580922000-07-07 19:07:47 +00002878 <para>
2879 Usage: sort [OPTION]... [FILE]...
2880 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002881
Eric Andersen21580922000-07-07 19:07:47 +00002882 <para>
2883 Sort lines of text in FILE(s).
2884 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002885
Eric Andersen21580922000-07-07 19:07:47 +00002886 <para>
2887 Options:
2888 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002889
Eric Andersen21580922000-07-07 19:07:47 +00002890 <para>
2891 <screen>
2892 -n Compare numerically
2893 -r Reverse after sorting
2894 </screen>
2895 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002896
Eric Andersen21580922000-07-07 19:07:47 +00002897 <para>
2898 Example:
2899 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002900
Eric Andersen21580922000-07-07 19:07:47 +00002901 <para>
2902 <screen>
2903 $ echo -e "e\nf\nb\nd\nc\na" | sort
2904 a
2905 b
2906 c
2907 d
2908 e
2909 f
2910 </screen>
2911 </para>
2912 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002913
Eric Andersen21580922000-07-07 19:07:47 +00002914 <sect1 id="swapoff">
2915 <title>swapoff</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002916
Eric Andersen21580922000-07-07 19:07:47 +00002917 <para>
2918 Usage: swapoff [OPTION] [DEVICE]
2919 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002920
Eric Andersen21580922000-07-07 19:07:47 +00002921 <para>
2922 Stop swapping virtual memory pages on DEVICE.
2923 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002924
Eric Andersen21580922000-07-07 19:07:47 +00002925 <para>
2926 Options:
2927 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002928
Eric Andersen21580922000-07-07 19:07:47 +00002929 <para>
2930 <screen>
2931 -a Stop swapping on all swap devices
2932 </screen>
2933 </para>
2934 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002935
Eric Andersen21580922000-07-07 19:07:47 +00002936 <sect1 id="swapon">
2937 <title>swapon</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002938
Eric Andersen21580922000-07-07 19:07:47 +00002939 <para>
2940 Usage: swapon [OPTION] [DEVICE]
2941 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002942
Eric Andersen21580922000-07-07 19:07:47 +00002943 <para>
2944 Start swapping virtual memory pages on the given device.
2945 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002946
Eric Andersen21580922000-07-07 19:07:47 +00002947 <para>
2948 Options:
2949 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002950
Eric Andersen21580922000-07-07 19:07:47 +00002951 <para>
2952 <screen>
2953 -a Start swapping on all swap devices
2954 </screen>
2955 </para>
2956 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002957
Eric Andersen21580922000-07-07 19:07:47 +00002958 <sect1 id="sync">
2959 <title>sync</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002960
Eric Andersen21580922000-07-07 19:07:47 +00002961 <para>
2962 Usage: sync
2963 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002964
Eric Andersen21580922000-07-07 19:07:47 +00002965 <para>
2966 Write all buffered filesystem blocks to disk.
2967 </para>
2968 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002969
Eric Andersen21580922000-07-07 19:07:47 +00002970 <sect1 id="syslogd">
2971 <title>syslogd</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002972
Eric Andersen21580922000-07-07 19:07:47 +00002973 <para>
2974 Usage: syslogd [OPTION]...
2975 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002976
Eric Andersen21580922000-07-07 19:07:47 +00002977 <para>
2978 Linux system and kernel (provides klogd) logging
2979 utility. Note that this version of syslogd/klogd ignores
2980 /etc/syslog.conf.
2981 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002982
Eric Andersen21580922000-07-07 19:07:47 +00002983 <para>
2984 Options:
2985 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002986
Eric Andersen21580922000-07-07 19:07:47 +00002987 <para>
2988 <screen>
2989 -m NUM Interval between MARK lines (default=20min, 0=off)
2990 -n Run as a foreground process
2991 -K Do not start up the klogd process
2992 -O FILE Use an alternate log file (default=/var/log/messages)
Eric Andersenced2cef2000-07-20 23:41:24 +00002993 -R HOST[:PORT] Log messages to HOST on PORT (default=514) over UDP.
Eric Andersen21580922000-07-07 19:07:47 +00002994 </screen>
2995 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002996
Eric Andersen21580922000-07-07 19:07:47 +00002997 <para>
2998 Example:
2999 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003000
Eric Andersen21580922000-07-07 19:07:47 +00003001 <para>
3002 <screen>
Eric Andersenced2cef2000-07-20 23:41:24 +00003003 $ syslogd -R masterlog:514
3004 $ syslogd -R 192.168.1.1:601
Eric Andersen21580922000-07-07 19:07:47 +00003005 </screen>
3006 </para>
3007 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003008
Eric Andersen21580922000-07-07 19:07:47 +00003009 <sect1 id="tail">
3010 <title>tail</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003011
Eric Andersen21580922000-07-07 19:07:47 +00003012 <para>
3013 Usage: tail [OPTION] [FILE]...
3014 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003015
Eric Andersen21580922000-07-07 19:07:47 +00003016 <para>
3017 Print last 10 lines of each FILE to standard output.
3018 With more than one FILE, precede each with a header
3019 giving the file name. With no FILE, or when FILE is -,
3020 read stdin.
3021 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003022
Eric Andersen21580922000-07-07 19:07:47 +00003023 <para>
3024 Options:
3025 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003026
Eric Andersen21580922000-07-07 19:07:47 +00003027 <para>
3028 <screen>
3029 -n NUM Print last NUM lines instead of last 10
3030 -f Output data as the file grows. This version
3031 of 'tail -f' supports only one file at a time.
3032 </screen>
3033 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003034
Eric Andersen21580922000-07-07 19:07:47 +00003035 <para>
3036 Example:
3037 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003038
Eric Andersen21580922000-07-07 19:07:47 +00003039 <para>
3040 <screen>
3041 $ tail -n 1 /etc/resolv.conf
3042 nameserver 10.0.0.1
3043 </screen>
3044 </para>
3045 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003046
Eric Andersen21580922000-07-07 19:07:47 +00003047 <sect1 id="tar">
3048 <title>tar</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003049
Eric Andersen21580922000-07-07 19:07:47 +00003050 <para>
3051 Usage: tar [MODE] [OPTION] [FILE]...
3052 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003053
Eric Andersen21580922000-07-07 19:07:47 +00003054 <para>
3055
3056 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003057
Eric Andersen21580922000-07-07 19:07:47 +00003058 <para>
3059 MODE may be chosen from
3060 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003061
Eric Andersen21580922000-07-07 19:07:47 +00003062 <para>
3063 <screen>
3064 c Create
3065 x Extract
3066 t List
3067 </screen>
3068 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003069
Eric Andersen21580922000-07-07 19:07:47 +00003070 <para>
3071 Options:
3072 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003073
Eric Andersen21580922000-07-07 19:07:47 +00003074 <para>
3075 <screen>
Eric Andersenfdd51032000-08-02 18:48:26 +00003076 f FILE Use FILE for tarfile (or stdin if '-')
3077 O Extract to stdout
3078 exclude FILE File to exclude
3079 v List files processed
Eric Andersen21580922000-07-07 19:07:47 +00003080 </screen>
3081 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003082
Eric Andersen21580922000-07-07 19:07:47 +00003083 <para>
3084 Example:
3085 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003086
Eric Andersen21580922000-07-07 19:07:47 +00003087 <para>
3088 <screen>
3089 $ zcat /tmp/tarball.tar.gz | tar -xf -
3090 $ tar -cf /tmp/tarball.tar /usr/local
3091 </screen>
3092 </para>
3093 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003094
Eric Andersen21580922000-07-07 19:07:47 +00003095 <sect1 id="tee">
3096 <title>tee</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003097
Eric Andersen21580922000-07-07 19:07:47 +00003098 <para>
3099 Usage: tee [OPTION]... [FILE]...
3100 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003101
Eric Andersen21580922000-07-07 19:07:47 +00003102 <para>
3103 Copy stdin to FILE(s), and also to stdout.
3104 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003105
Eric Andersen21580922000-07-07 19:07:47 +00003106 <para>
3107 Options:
3108 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003109
Eric Andersen21580922000-07-07 19:07:47 +00003110 <para>
3111 <screen>
3112 -a Append to the given FILEs, do not overwrite
3113 </screen>
3114 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003115
Eric Andersen21580922000-07-07 19:07:47 +00003116 <para>
3117 Example:
3118 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003119
Eric Andersen21580922000-07-07 19:07:47 +00003120 <para>
3121 <screen>
3122 $ echo "Hello" | tee /tmp/foo
3123 Hello
3124 $ cat /tmp/foo
3125 Hello
3126 </screen>
3127 </para>
3128 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003129
Eric Andersen21580922000-07-07 19:07:47 +00003130 <sect1 id="telnet">
3131 <title>telnet</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003132
Eric Andersen21580922000-07-07 19:07:47 +00003133 <para>
3134 Usage: telnet HOST [PORT]
3135 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003136
Eric Andersen21580922000-07-07 19:07:47 +00003137 <para>
3138 Establish interactive communication with another
3139 computer over a network using the TELNET protocol.
3140 </para>
3141 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003142
Eric Andersen21580922000-07-07 19:07:47 +00003143 <sect1 id="test">
3144 <title>test, [</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003145
Eric Andersen21580922000-07-07 19:07:47 +00003146 <para>
3147 Usage: test EXPRESSION
3148 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003149
Eric Andersen21580922000-07-07 19:07:47 +00003150 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003151 or: [ EXPRESSION ]
Pavel Roskind2d3aa32000-09-15 17:16:40 +00003152 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003153
Eric Andersen21580922000-07-07 19:07:47 +00003154 <para>
3155 Check file types and compare values returning an exit
3156 code determined by the value of EXPRESSION.
3157 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003158
Eric Andersen21580922000-07-07 19:07:47 +00003159 <para>
3160 Example:
3161 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003162
Eric Andersen21580922000-07-07 19:07:47 +00003163 <para>
3164 <screen>
3165 $ test 1 -eq 2
3166 $ echo $?
3167 1
3168 $ test 1 -eq 1
3169 $ echo $?
3170 0
3171 $ [ -d /etc ]
3172 $ echo $?
3173 0
3174 $ [ -d /junk ]
3175 $ echo $?
3176 1
3177 </screen>
3178 </para>
3179 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003180
Eric Andersen21580922000-07-07 19:07:47 +00003181 <sect1 id="touch">
3182 <title>touch</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003183
Eric Andersen21580922000-07-07 19:07:47 +00003184 <para>
3185 Usage: touch [OPTION]... FILE...
3186 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003187
Eric Andersen21580922000-07-07 19:07:47 +00003188 <para>
3189 Update the last-modified date on (or create) FILE(s).
3190 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003191
Eric Andersen21580922000-07-07 19:07:47 +00003192 <para>
3193 Options:
3194 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003195
Eric Andersen21580922000-07-07 19:07:47 +00003196 <para>
3197 <screen>
3198 -c Do not create files
3199 </screen>
3200 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003201
Eric Andersen21580922000-07-07 19:07:47 +00003202 <para>
3203 Example:
3204 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003205
Eric Andersen21580922000-07-07 19:07:47 +00003206 <para>
3207 <screen>
3208 $ ls -l /tmp/foo
3209 /bin/ls: /tmp/foo: No such file or directory
3210 $ touch /tmp/foo
3211 $ ls -l /tmp/foo
3212 -rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo
3213 </screen>
3214 </para>
3215 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003216
Eric Andersen21580922000-07-07 19:07:47 +00003217 <sect1 id="tr">
3218 <title>tr</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003219
Eric Andersen21580922000-07-07 19:07:47 +00003220 <para>
3221 Usage: tr [OPTION]... STRING1 [STRING2]
3222 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003223
Eric Andersen21580922000-07-07 19:07:47 +00003224 <para>
3225 Translate, squeeze, and/or delete characters from stdin,
3226 writing to stdout.
3227 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003228
Eric Andersen21580922000-07-07 19:07:47 +00003229 <para>
3230 Options:
3231 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003232
Eric Andersen21580922000-07-07 19:07:47 +00003233 <para>
3234 <screen>
3235 -c Take complement of STRING1
3236 -d Delete input characters coded STRING1
3237 -s Squeeze multiple output characters of STRING2 into one character
3238 </screen>
3239 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003240
Eric Andersen21580922000-07-07 19:07:47 +00003241 <para>
3242 Example:
3243 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003244
Eric Andersen21580922000-07-07 19:07:47 +00003245 <para>
3246 <screen>
3247 $ echo "gdkkn vnqkc" | tr [a-y] [b-z]
3248 hello world
3249 </screen>
3250 </para>
3251 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003252
Eric Andersen21580922000-07-07 19:07:47 +00003253 <sect1 id="true">
3254 <title>true</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003255
Eric Andersen21580922000-07-07 19:07:47 +00003256 <para>
3257 Usage: true
3258 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003259
Eric Andersen21580922000-07-07 19:07:47 +00003260 <para>
3261 Return an exit code of TRUE (1).
3262 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003263
Eric Andersen21580922000-07-07 19:07:47 +00003264 <para>
3265 Example:
3266 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003267
Eric Andersen21580922000-07-07 19:07:47 +00003268 <para>
3269 <screen>
3270 $ true
3271 $ echo $?
3272 0
3273 </screen>
3274 </para>
3275 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003276
Eric Andersen21580922000-07-07 19:07:47 +00003277 <sect1 id="tty">
3278 <title>tty</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003279
Eric Andersen21580922000-07-07 19:07:47 +00003280 <para>
3281 Usage: tty
3282 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003283
Eric Andersen21580922000-07-07 19:07:47 +00003284 <para>
3285 Print the file name of the terminal connected to stdin.
3286 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003287
Eric Andersen21580922000-07-07 19:07:47 +00003288 <para>
3289 Options:
3290 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003291
Eric Andersen21580922000-07-07 19:07:47 +00003292 <para>
3293 <screen>
3294 -s Print nothing, only return an exit status
3295 </screen>
3296 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003297
Eric Andersen21580922000-07-07 19:07:47 +00003298 <para>
3299 Example:
3300 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003301
Eric Andersen21580922000-07-07 19:07:47 +00003302 <para>
3303 <screen>
3304 $ tty
3305 /dev/tty2
3306 </screen>
3307 </para>
3308 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003309
Eric Andersen21580922000-07-07 19:07:47 +00003310 <sect1 id="umount">
3311 <title>umount</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003312
Eric Andersen21580922000-07-07 19:07:47 +00003313 <para>
3314 Usage: umount [OPTION]... DEVICE|DIRECTORY
3315 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003316
Eric Andersen21580922000-07-07 19:07:47 +00003317 <para>
3318
3319 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003320
Eric Andersen21580922000-07-07 19:07:47 +00003321 <para>
3322 Options:
3323 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003324
Eric Andersen21580922000-07-07 19:07:47 +00003325 <para>
3326 <screen>
3327 -a Unmount all file systems
3328 -r Try to remount devices as read-only if mount is busy
3329 -f Force filesystem umount (i.e. unreachable NFS server)
3330 -l Do not free loop device (if a loop device has been used)
3331 </screen>
3332 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003333
Eric Andersen21580922000-07-07 19:07:47 +00003334 <para>
3335 Example:
3336 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003337
Eric Andersen21580922000-07-07 19:07:47 +00003338 <para>
3339 <screen>
3340 $ umount /dev/hdc1
3341 </screen>
3342 </para>
3343 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003344
Eric Andersen21580922000-07-07 19:07:47 +00003345 <sect1 id="uname">
3346 <title>uname</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003347
Eric Andersen21580922000-07-07 19:07:47 +00003348 <para>
3349 Usage: uname [OPTION]...
3350 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003351
Eric Andersen21580922000-07-07 19:07:47 +00003352 <para>
3353 Print certain system information. With no OPTION, same
3354 as -s.
3355 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003356
Eric Andersen21580922000-07-07 19:07:47 +00003357 <para>
3358 Options:
3359 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003360
Eric Andersen21580922000-07-07 19:07:47 +00003361 <para>
3362 <screen>
3363 -a Print all information
3364 -m Print the machine (hardware) type
3365 -n Print the machine's network node hostname
3366 -r Print the operating system release
3367 -s Print the operating system name
3368 -p Print the host processor type
3369 -v Print the operating system version
3370 </screen>
3371 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003372
Eric Andersen21580922000-07-07 19:07:47 +00003373 <para>
3374 Example:
3375 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003376
Eric Andersen21580922000-07-07 19:07:47 +00003377 <para>
3378 <screen>
3379 $ uname -a
3380 Linux debian 2.2.15pre13 #5 Tue Mar 14 16:03:50 MST 2000 i686 unknown
3381 </screen>
3382 </para>
3383 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003384
Eric Andersen21580922000-07-07 19:07:47 +00003385 <sect1 id="uniq">
3386 <title>uniq</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003387
Eric Andersen21580922000-07-07 19:07:47 +00003388 <para>
3389 Usage: uniq [INPUT [OUTPUT]]
3390 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003391
Eric Andersen21580922000-07-07 19:07:47 +00003392 <para>
3393 Discard all but one of successive identical lines from
3394 INPUT (or stdin), writing to OUTPUT (or stdout).
3395 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003396
Eric Andersen21580922000-07-07 19:07:47 +00003397 <para>
3398 Example:
3399 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003400
Eric Andersen21580922000-07-07 19:07:47 +00003401 <para>
3402 <screen>
3403 $ echo -e "a\na\nb\nc\nc\na" | sort | uniq
3404 a
3405 b
3406 c
3407 </screen>
3408 </para>
3409 </sect1>
Eric Andersencff3fe32000-09-20 19:22:26 +00003410
3411 <sect1 id="unix2dos">
3412 <title>unix2dos</title>
3413
3414 <para>
3415 Usage: unix2dos < unixfile > dosfile
3416 </para>
3417
3418 <para>
3419 Converts a text file from unix format to dos format.
3420 </para>
3421
3422 </sect1>
3423
3424 <sect1 id="unrpm">
Eric Andersen57f83ff2000-09-24 02:41:44 +00003425 <title>unrpm</title>
Eric Andersencff3fe32000-09-20 19:22:26 +00003426
3427 <para>
3428 Usage: unrpm < package.rpm | gzip -d | cpio -idmuv
3429 </para>
3430
3431 <para>
3432 Extracts an rpm archive.
3433 </para>
3434
3435 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003436
Eric Andersen21580922000-07-07 19:07:47 +00003437 <sect1 id="update">
3438 <title>update</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003439
Eric Andersen21580922000-07-07 19:07:47 +00003440 <para>
3441 Usage: update [OPTION]...
3442 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003443
Eric Andersen21580922000-07-07 19:07:47 +00003444 <para>
3445 Periodically flush filesystem buffers.
3446 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003447
Eric Andersen21580922000-07-07 19:07:47 +00003448 <para>
3449 Options:
3450 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003451
Eric Andersen21580922000-07-07 19:07:47 +00003452 <para>
3453 <screen>
3454 -S Force use of sync(2) instead of flushing
3455 -s SECS Call sync this often (default 30)
3456 -f SECS Flush some buffers this often (default 5)
3457 </screen>
3458 </para>
3459 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003460
Eric Andersen21580922000-07-07 19:07:47 +00003461 <sect1 id="uptime">
3462 <title>uptime</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003463
Eric Andersen21580922000-07-07 19:07:47 +00003464 <para>
3465 Usage: uptime
3466 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003467
Eric Andersen21580922000-07-07 19:07:47 +00003468 <para>
3469 Display how long the system has been running since boot.
3470 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003471
Eric Andersen21580922000-07-07 19:07:47 +00003472 <para>
3473 Example:
3474 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003475
Eric Andersen21580922000-07-07 19:07:47 +00003476 <para>
3477 <screen>
3478 $ uptime
3479 1:55pm up 2:30, load average: 0.09, 0.04, 0.00
3480 </screen>
3481 </para>
3482 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003483
Eric Andersen21580922000-07-07 19:07:47 +00003484 <sect1 id="usleep">
3485 <title>usleep</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003486
Eric Andersen21580922000-07-07 19:07:47 +00003487 <para>
3488 Usage: usleep N
3489 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003490
Eric Andersen21580922000-07-07 19:07:47 +00003491 <para>
3492 Pause for N microseconds.
3493 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003494
Eric Andersen21580922000-07-07 19:07:47 +00003495 <para>
3496 Example:
3497 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003498
Eric Andersen21580922000-07-07 19:07:47 +00003499 <para>
3500 <screen>
3501 $ usleep 1000000
3502 [pauses for 1 second]
3503 </screen>
3504 </para>
3505 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003506
Eric Andersen21580922000-07-07 19:07:47 +00003507 <sect1 id="uudecode">
3508 <title>uudecode</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003509
Eric Andersen21580922000-07-07 19:07:47 +00003510 <para>
3511 Usage: uudecode [OPTION] [FILE]
3512 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003513
Eric Andersen21580922000-07-07 19:07:47 +00003514 <para>
3515 Uudecode a uuencoded file.
3516 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003517
Eric Andersen21580922000-07-07 19:07:47 +00003518 <para>
3519 Options:
3520 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003521
Eric Andersen21580922000-07-07 19:07:47 +00003522 <para>
3523 <screen>
3524 -o FILE Direct output to FILE
3525 </screen>
3526 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003527
Eric Andersen21580922000-07-07 19:07:47 +00003528 <para>
3529 Example:
3530 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003531
Eric Andersen21580922000-07-07 19:07:47 +00003532 <para>
3533 <screen>
3534 $ uudecode -o busybox busybox.uu
3535 $ ls -l busybox
3536 -rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox
3537 </screen>
3538 </para>
3539 </sect1>
Eric Andersen028fb622000-07-04 20:07:13 +00003540
Eric Andersen21580922000-07-07 19:07:47 +00003541 <sect1 id="uuencode">
3542 <title>uuencode</title>
Eric Andersen028fb622000-07-04 20:07:13 +00003543
Eric Andersen21580922000-07-07 19:07:47 +00003544 <para>
3545 Usage: uuencode [OPTION] [INFILE] OUTFILE
3546 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003547
Eric Andersen21580922000-07-07 19:07:47 +00003548 <para>
3549 Uuencode a file.
3550 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003551
Eric Andersen21580922000-07-07 19:07:47 +00003552 <para>
3553 Options:
3554 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003555
Eric Andersen21580922000-07-07 19:07:47 +00003556 <para>
3557 <screen>
3558 -m Use base64 encoding as of RFC1521
3559 </screen>
3560 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003561
Eric Andersen21580922000-07-07 19:07:47 +00003562 <para>
3563 Example:
3564 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003565
Eric Andersen21580922000-07-07 19:07:47 +00003566 <para>
3567 <screen>
3568 $ uuencode busybox busybox
3569 begin 755 busybox
3570 M?T5,1@$!`0````````````(``P`!````L+@$"#0```!0N@,``````#0`(``&amp;
3571 .....
3572 $ uudecode busybox busybox &gt; busybox.uu
3573 $
3574 </screen>
3575 </para>
3576 </sect1>
Eric Andersen028fb622000-07-04 20:07:13 +00003577
Eric Andersen21580922000-07-07 19:07:47 +00003578 <sect1 id="wc">
3579 <title>wc</title>
Eric Andersen028fb622000-07-04 20:07:13 +00003580
Eric Andersen21580922000-07-07 19:07:47 +00003581 <para>
3582 Usage: wc [OPTION]... [FILE]...
3583 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003584
Eric Andersen21580922000-07-07 19:07:47 +00003585 <para>
3586 Print line, word, and byte counts for each FILE, and a
3587 total line if more than one FILE is specified. With no
3588 FILE, read stdin.
3589 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003590
Eric Andersen21580922000-07-07 19:07:47 +00003591 <para>
3592 Options:
3593 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003594
Eric Andersen21580922000-07-07 19:07:47 +00003595 <para>
3596 <screen>
3597 -c Print the byte counts
3598 -l Print the newline counts
3599 -L Print the length of the longest line
3600 -w Print the word counts
3601 </screen>
3602 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003603
Eric Andersen21580922000-07-07 19:07:47 +00003604 <para>
3605 Example:
3606 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003607
Eric Andersen21580922000-07-07 19:07:47 +00003608 <para>
3609 <screen>
3610 $ wc /etc/passwd
3611 31 46 1365 /etc/passwd
3612 </screen>
3613 </para>
3614 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003615
Eric Andersen21580922000-07-07 19:07:47 +00003616 <sect1 id="which">
3617 <title>which</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003618
Eric Andersen21580922000-07-07 19:07:47 +00003619 <para>
3620 Usage: which [COMMAND]...
3621 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003622
Eric Andersen21580922000-07-07 19:07:47 +00003623 <para>
3624 Locate COMMAND(s).
3625 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003626
Eric Andersen21580922000-07-07 19:07:47 +00003627 <para>
3628 Example:
3629 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003630
Eric Andersen21580922000-07-07 19:07:47 +00003631 <para>
3632 <screen>
3633 $ which login
3634 /bin/login
3635 </screen>
3636 </para>
3637 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003638
Eric Andersen21580922000-07-07 19:07:47 +00003639 <sect1 id="whoami">
3640 <title>whoami</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003641
Eric Andersen21580922000-07-07 19:07:47 +00003642 <para>
3643 Usage: whoami
3644 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003645
Eric Andersen21580922000-07-07 19:07:47 +00003646 <para>
3647 Print the user name associated with the current
3648 effective user id.
3649 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003650
Eric Andersen21580922000-07-07 19:07:47 +00003651 <para>
3652 Example:
3653 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003654
Eric Andersen21580922000-07-07 19:07:47 +00003655 <para>
3656 <screen>
3657 $ whoami
3658 andersen
3659 </screen>
3660 </para>
3661 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003662
Eric Andersen5b176932000-09-22 20:22:28 +00003663 <sect1 id="xargs">
3664 <title>xargs</title>
3665
3666 <para>
3667 Usage: xargs [OPTIONS] [COMMAND] [ARGS...]
3668 </para>
3669
3670 <para>
3671 Executes COMMAND on every item given by standard input.
3672 </para>
3673
3674 <para>
3675 Options:
3676 </para>
3677
3678 <para>
3679 <screen>
3680 -t Print the command just before it is run
Eric Andersen5b176932000-09-22 20:22:28 +00003681 </screen>
3682 </para>
3683
3684
3685 <para>
3686 Example:
3687 </para>
3688
3689 <para>
3690 <screen>
3691 $ ls | xargs gzip
3692 $ find . -name '*.c' -print | xargs rm
3693 </screen>
3694 </para>
3695 </sect1>
3696
Eric Andersen21580922000-07-07 19:07:47 +00003697 <sect1 id="yes">
3698 <title>yes</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003699
Eric Andersen21580922000-07-07 19:07:47 +00003700 <para>
3701 Usage: yes [STRING]...
3702 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003703
Eric Andersen21580922000-07-07 19:07:47 +00003704 <para>
3705 Repeatedly output a line with all specified STRING(s),
3706 or `y'.
3707 </para>
3708 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003709
Eric Andersen21580922000-07-07 19:07:47 +00003710 <sect1 id="zcat">
3711 <title>zcat</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003712
Eric Andersen21580922000-07-07 19:07:47 +00003713 <para>
3714 Usage: zcat [OPTION]... FILE
3715 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003716
Eric Andersen21580922000-07-07 19:07:47 +00003717 <para>
3718 Uncompress FILE (or stdin if FILE is '-') to stdout.
3719 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003720
Eric Andersen21580922000-07-07 19:07:47 +00003721 <para>
3722 Options:
3723 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003724
Eric Andersen21580922000-07-07 19:07:47 +00003725 <para>
3726 <screen>
3727 -t Test compressed file integrity
3728 </screen>
3729 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003730
Eric Andersen21580922000-07-07 19:07:47 +00003731 <para>
3732 Example:
3733 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003734
Eric Andersen21580922000-07-07 19:07:47 +00003735 <para>
3736 <screen>
3737 </screen>
3738 </para>
3739 </sect1>
3740 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +00003741
Eric Andersen21580922000-07-07 19:07:47 +00003742 <chapter id="LIBC-NSS">
3743 <title>LIBC NSS</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003744
Eric Andersen21580922000-07-07 19:07:47 +00003745 <para>
3746 GNU Libc uses the Name Service Switch (NSS) to configure the
3747 behavior of the C library for the local environment, and to
3748 configure how it reads system data, such as passwords and group
3749 information. BusyBox has made it Policy that it will never use
3750 NSS, and will never use libc calls that make use of NSS. This
3751 allows you to run an embedded system without the need for
3752 installing an /etc/nsswitch.conf file and without /lib/libnss_*
3753 libraries installed.
3754 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003755
Eric Andersen21580922000-07-07 19:07:47 +00003756 <para>
3757 If you are using a system that is using a remote LDAP server for
3758 authentication via GNU libc NSS, and you want to use BusyBox,
3759 then you will need to adjust the BusyBox source. Chances are
3760 though, that if you have enough space to install of that stuff
3761 on your system, then you probably want the full GNU utilities.
3762 </para>
3763 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +00003764
Eric Andersen21580922000-07-07 19:07:47 +00003765 <chapter id="SEE-ALSO">
3766 <title>SEE ALSO</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003767
Eric Andersen21580922000-07-07 19:07:47 +00003768 <para>
3769 <literal>textutils(1),</literal>
3770 <literal>shellutils(1),</literal>
3771 etc...
3772 </para>
3773 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +00003774
Eric Andersen21580922000-07-07 19:07:47 +00003775 <chapter id="MAINTAINER">
3776 <title>MAINTAINER</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003777
Eric Andersen21580922000-07-07 19:07:47 +00003778 <para>
3779 Erik Andersen &lt;andersee@debian.org&gt; &lt;andersen@lineo.com&gt;
3780 </para>
3781 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +00003782
Eric Andersen21580922000-07-07 19:07:47 +00003783 <chapter id="AUTHORS">
3784 <title>AUTHORS</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003785
Eric Andersen21580922000-07-07 19:07:47 +00003786 <para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003787 The following people have made significant contributions to
3788 BusyBox -- whether they know it or not.
Eric Andersen21580922000-07-07 19:07:47 +00003789 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003790
Eric Andersen21580922000-07-07 19:07:47 +00003791 <para>
3792 Erik Andersen &lt;andersee@debian.org&gt;
3793 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003794
Eric Andersen21580922000-07-07 19:07:47 +00003795 <para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003796 Edward Betts &lt;edward@debian.org&gt;
3797 </para>
3798
3799 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003800 John Beppu &lt;beppu@lineo.com&gt;
3801 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003802
Eric Andersen21580922000-07-07 19:07:47 +00003803 <para>
3804 Brian Candler &lt;B.Candler@pobox.com&gt;
3805 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003806
Eric Andersen21580922000-07-07 19:07:47 +00003807 <para>
3808 Randolph Chung &lt;tausq@debian.org&gt;
3809 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003810
Eric Andersen21580922000-07-07 19:07:47 +00003811 <para>
3812 Dave Cinege &lt;dcinege@psychosis.com&gt;
3813 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003814
Eric Andersen21580922000-07-07 19:07:47 +00003815 <para>
3816 Karl M. Hegbloom &lt;karlheg@debian.org&gt;
3817 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003818
Eric Andersen21580922000-07-07 19:07:47 +00003819 <para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003820 Daniel Jacobowitz &lt;dan@debian.org&gt;
3821 </para>
3822
3823 <para>
3824 Matt Kraai &lt;kraai@alumni.carnegiemellon.edu&gt;
3825 </para>
3826
3827 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003828 John Lombardo &lt;john@deltanet.com&gt;
3829 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003830
Eric Andersen21580922000-07-07 19:07:47 +00003831 <para>
3832 Glenn McGrath &lt;bug1@netconnect.com.au&gt;
3833 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003834
Eric Andersen21580922000-07-07 19:07:47 +00003835 <para>
3836 Bruce Perens &lt;bruce@perens.com&gt;
3837 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003838
Eric Andersen21580922000-07-07 19:07:47 +00003839 <para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003840 Chip Rosenthal &lt;chip@unicom.com&gt;, &lt;crosenth@covad.com&gt;
3841 </para>
3842
3843 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003844 Pavel Roskin &lt;proski@gnu.org&gt;
3845 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003846
Eric Andersen21580922000-07-07 19:07:47 +00003847 <para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003848 Gyepi Sam &lt;gyepi@praxis-sw.com&gt;
3849 </para>
3850
3851 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003852 Linus Torvalds &lt;torvalds@transmeta.com&gt;
3853 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003854
John Beppu2aee9932000-09-15 08:04:42 +00003855 <para>
3856 Mark Whitley &lt;markw@lineo.com&gt;
3857 </para>
3858
Eric Andersen21580922000-07-07 19:07:47 +00003859 <para>
3860 Charles P. Wright &lt;cpwright@villagenet.com&gt;
3861 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003862
Eric Andersen21580922000-07-07 19:07:47 +00003863 <para>
3864 Enrique Zanardi &lt;ezanardi@ull.es&gt;
3865 </para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003866
3867
Eric Andersen21580922000-07-07 19:07:47 +00003868 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +00003869</book> <!-- End of the book -->