blob: 02d85e499fcb8d2fcd10af176aa341e563c10205 [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,
Glenn L McGrathfa044322001-01-03 01:06:30 +0000140 cp, cut, date, dc, dd, deallocvt, df, dirname, dmesg, dpkg-deb,
141 du, dumpkmap, dutmp, echo, false, fbset, fdflush, find, free,
Eric Andersen61dc0572000-07-11 17:29:36 +0000142 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
Glenn L McGrathfa044322001-01-03 01:06:30 +0000761 <sect1 id="dpkg-deb">
762 <title>dpkg-deb</title>
763
764 <para>
765 Usage: dpkg-deb [OPTION] archive [directory]
766 </para>
767
768 <para>
769 Debian package archive (.deb) manipulation tool
770 </para>
771
772 <para>
773 Options:
774 </para>
775
776 <para>
777 <screen>
778 -c List the contents of the filesystem tree archive portion of the package
779 -e Extracts the control information files from a package archive into the specified directory.
780 If no directory is specified then a subdirectory DEBIAN in the current directory is used.
781 -x Silently extracts the filesystem tree from a package archive into the specified directory.
782 -X Extracts the filesystem tree from a package archive into the specified directory, listing the files as it goes.
783 If required the specified directory (but not its parents) will be created.
784 </screen>
785 <para>
786
787 <para>
788 Example:
789 </para>
790
791 <para>
792 <screen>
793 dpkg-deb -e ./busybox_0.48-1_i386.deb
794 dpkg-deb -x ./busybox_0.48-1_i386.deb ./unpack_dir
795 </screen>
796 </para>
797 </sect1>
798
Eric Andersen6f5e2812000-07-06 16:58:45 +0000799 <sect1 id="du">
800 <title>du</title>
801
802 <para>
803 Usage: du [OPTION]... [FILE]...
804 </para>
805
806 <para>
807 Summarize the disk space used for each FILE or current
808 directory. Disk space printed in units of 1k (i.e.
809 1024 bytes).
810 </para>
811
812 <para>
813 Options:
814 </para>
815
816 <para>
817 <screen>
818 -l Count sizes many times if hard linked
819 -s Display only a total for each argument
820 </screen>
821 </para>
822
823 <para>
824 Example:
825 </para>
826
827 <para>
828 <screen>
829 $ du
830 16 ./CVS
831 12 ./kernel-patches/CVS
832 80 ./kernel-patches
833 12 ./tests/CVS
834 36 ./tests
835 12 ./scripts/CVS
836 16 ./scripts
837 12 ./docs/CVS
838 104 ./docs
839 2417 .
840 </screen>
841 </para>
842 </sect1>
843
Eric Andersen61dc0572000-07-11 17:29:36 +0000844 <sect1 id="dumpkmap">
845 <title>dumpkmap</title>
846
847 <para>
848 Usage: dumpkmap
849 </para>
850
851 <para>
Eric Andersen337ec1b2000-11-17 17:23:16 +0000852 Prints out a binary keyboard translation table to standard output.
Eric Andersen61dc0572000-07-11 17:29:36 +0000853 </para>
Eric Andersen18a10142000-09-01 16:12:57 +0000854
855 <para>
856 Example:
857 </para>
858
859 <para>
860 <screen>
861 $ dumpkmap &lt; keymap
862 </screen>
863 </para>
Eric Andersen61dc0572000-07-11 17:29:36 +0000864 </sect1>
865
Eric Andersen6f5e2812000-07-06 16:58:45 +0000866 <sect1 id="dutmp">
867 <title>dutmp</title>
868
869 <para>
870 Usage: dutmp [FILE]
871 </para>
872
873 <para>
874 Dump utmp file format (pipe delimited) from FILE or
875 stdin to stdout.
876 </para>
877
878 <para>
879 Example:
880 </para>
881
882 <para>
883 <screen>
884 $ dutmp /var/run/utmp
885 8|7||si|||0|0|0|955637625|760097|0
886 2|0|~|~~|reboot||0|0|0|955637625|782235|0
887 1|20020|~|~~|runlevel||0|0|0|955637625|800089|0
888 8|125||l4|||0|0|0|955637629|998367|0
889 6|245|tty1|1|LOGIN||0|0|0|955637630|998974|0
890 6|246|tty2|2|LOGIN||0|0|0|955637630|999498|0
891 7|336|pts/0|vt00andersen|andersen|:0.0|0|0|0|955637763|0|0
892 </screen>
893 </para>
894 </sect1>
895
896 <sect1 id="echo">
897 <title>echo</title>
898
899 <para>
900 Usage: echo [OPTION]... [ARG]...
901 </para>
902
903 <para>
904 Print ARGs to stdout.
905 </para>
906
907 <para>
908 Options:
909 </para>
910
911 <para>
912 <screen>
913 -n Suppress trailing newline
914 -e Enable interpretation of escaped characters
915 -E Disable interpretation of escaped characters
916 </screen>
917 </para>
918
919 <para>
920 Example:
921 </para>
922
923 <para>
924 <screen>
925 $ echo "Erik is cool"
926 Erik is cool
927 $ echo -e "Erik\nis\ncool"
928 Erik
929 is
930 cool
931 $ echo "Erik\nis\ncool"
932 Erik\nis\ncool
933 </screen>
934 </para>
935 </sect1>
936
Eric Andersen1b355eb2000-09-05 17:37:48 +0000937 <sect1 id="expr">
938 <title>expr</title>
939
940 <para>
941 Usage: expr EXPRESSION
942 </para>
943
944 <para>
945 Prints the value of EXPRESSION to standard output.
946 </para>
947
948 <para>
949 EXPRESSION may be:
950 </para>
951
952 <para>
953 <screen>
954 ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2
955 ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0
956 ARG1 &lt ARG2 ARG1 is less than ARG2
957 ARG1 &lt= ARG2 ARG1 is less than or equal to ARG2
958 ARG1 = ARG2 ARG1 is equal to ARG2
959 ARG1 != ARG2 ARG1 is unequal to ARG2
960 ARG1 &gt= ARG2 ARG1 is greater than or equal to ARG2
961 ARG1 &gt ARG2 ARG1 is greater than ARG2
962 ARG1 + ARG2 arithmetic sum of ARG1 and ARG2
963 ARG1 - ARG2 arithmetic difference of ARG1 and ARG2
964 ARG1 * ARG2 arithmetic product of ARG1 and ARG2
965 ARG1 / ARG2 arithmetic quotient of ARG1 divided by ARG2
966 ARG1 % ARG2 arithmetic remainder of ARG1 divided by ARG2
967 STRING : REGEXP anchored pattern match of REGEXP in STRING
968 match STRING REGEXP same as STRING : REGEXP
969 substr STRING POS LENGTH substring of STRING, POS counted from 1
970 index STRING CHARS index in STRING where any CHARS is found, or 0
971 length STRING length of STRING
972 quote TOKEN interpret TOKEN as a string, even if it is a
973 keyword like `match' or an operator like `/'
974 ( EXPRESSION ) value of EXPRESSION
975 </screen>
976 </para>
977
978 <para>
979 Beware that many operators need to be escaped or quoted for shells.
980 Comparisons are arithmetic if both ARGs are numbers, else
981 lexicographical. Pattern matches return the string matched between
982 \( and \) or null; if \( and \) are not used, they return the number
983 of characters matched or 0.
984 </para>
985
986 </sect1>
987
988
Eric Andersen6f5e2812000-07-06 16:58:45 +0000989 <sect1 id="false">
990 <title>false</title>
991
992 <para>
993 Usage: false
994 </para>
995
996 <para>
Eric Andersen21580922000-07-07 19:07:47 +0000997 Return an exit code of FALSE (1).
Eric Andersen6f5e2812000-07-06 16:58:45 +0000998 </para>
999
1000 <para>
1001 Example:
1002 </para>
1003
1004 <para>
1005 <screen>
1006 $ false
1007 $ echo $?
1008 1
1009 </screen>
1010 </para>
1011 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00001012
Eric Andersene5cec4e2000-07-06 19:59:22 +00001013 <sect1 id="fbset">
1014 <title>fbset</title>
1015
1016 <para>
1017 Usage: fbset [OPTION]... [MODE]
1018 </para>
1019
1020 <para>
1021 Show and modify frame buffer device settings.
1022 </para>
1023
1024 <para>
1025 Options:
1026 </para>
1027
1028 <para>
1029 <screen>
1030 -h Display option summary
1031 -fb DEVICE Operate on DEVICE
1032 -db FILE Use FILE for mode database
1033 -g XRES YRES VXRES VYRES DEPTH Set all geometry parameters
1034 -t PIXCLOCK LEFT RIGHT UPPER LOWER HSLEN VSLEN Set all timing parameters
1035 -xres RES Set visible horizontal resolution
1036 -yres RES Set visible vertical resolution
1037 </screen>
1038 </para>
1039
1040 <para>
1041 Example:
1042 </para>
1043
1044 <para>
1045 <screen>
1046 $ fbset
1047 mode "1024x768-76"
1048 # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz
1049 geometry 1024 768 1024 768 16
1050 timings 12714 128 32 16 4 128 4
1051 accel false
1052 rgba 5/11,6/5,5/0,0/0
1053 endmode
1054 </screen>
1055 </para>
1056 </sect1>
1057
1058 <sect1 id="fdflush">
1059 <title>fdflush</title>
1060
1061 <para>
1062 Usage: fdflush DEVICE
1063 </para>
1064
1065 <para>
1066 Force floppy disk drive to detect disk change on DEVICE.
1067 </para>
1068 </sect1>
1069
1070 <sect1 id="find">
1071 <title>find</title>
1072
1073 <para>
1074 Usage: find [PATH]... [EXPRESSION]
1075 </para>
1076
1077 <para>
1078 Search for files in a directory hierarchy. The default
1079 PATH is the current directory; default EXPRESSION is
1080 '-print'.
1081 </para>
1082
1083 <para>
1084 EXPRESSION may consist of:
1085 </para>
1086
1087 <para>
1088 <screen>
1089 -follow Dereference symbolic links
1090 -name PATTERN File name (leading directories removed) matches PATTERN
Matt Kraaidf8ccb62001-02-07 04:05:35 +00001091 -type X Filetype matches X (where X is one of: f,d,l,b,c,...)
1092 -perm PERMS Permissions match any of (+NNN); all of (-NNN); or exactly (NNN)
1093 -mtime TIME Modified time is greater than (+N); less than (-N); or exactly (N) days
Eric Andersene5cec4e2000-07-06 19:59:22 +00001094 </screen>
1095 </para>
1096
1097 <para>
1098 Example:
1099 </para>
1100
1101 <para>
1102 <screen>
1103 $ find / -name /etc/passwd
1104 /etc/passwd
1105 </screen>
1106 </para>
1107 </sect1>
1108
1109 <sect1 id="free">
1110 <title>free</title>
1111
1112 <para>
1113 Usage: free
1114 </para>
1115
1116 <para>
1117 Displays the amount of free and used system memory.
1118 </para>
1119
1120 <para>
1121 Example:
1122 </para>
1123
1124 <para>
1125 <screen>
1126 $ free
1127 total used free shared buffers
1128 Mem: 257628 248724 8904 59644 93124
1129 Swap: 128516 8404 120112
1130 Total: 386144 257128 129016
1131 </screen>
1132 </para>
1133 </sect1>
1134
1135 <sect1 id="freeramdisk">
1136 <title>freeramdisk</title>
1137
1138 <para>
1139 Usage: freeramdisk DEVICE
1140 </para>
1141
1142 <para>
1143 Free all memory used by the ramdisk DEVICE.
1144 </para>
1145
1146 <para>
1147 Example:
1148 </para>
1149
1150 <para>
1151 <screen>
1152 $ freeramdisk /dev/ram2
1153 </screen>
1154 </para>
1155 </sect1>
1156
1157 <sect1 id="fsck.minix">
1158 <title>fsck.minix</title>
1159
1160 <para>
1161 Usage: fsck.minix [OPTION]... DEVICE
1162 </para>
1163
1164 <para>
1165 Perform a consistency check on the MINIX filesystem on
1166 DEVICE.
1167 </para>
1168
1169 <para>
1170 Options:
1171 </para>
1172
1173 <para>
1174 <screen>
1175 -l List all filenames
1176 -r Perform interactive repairs
1177 -a Perform automatic repairs
1178 -v Verbose
1179 -s Output super-block information
1180 -m Activate MINIX-like "mode not cleared" warnings
1181 -f Force file system check.
1182 </screen>
1183 </para>
1184 </sect1>
Eric Andersena1f16bb2000-08-21 22:02:34 +00001185
1186 <sect1 id="getopt">
1187 <title>getopt</title>
1188
1189 <para>
1190 Usage: getopt [OPTIONS]...
1191 </para>
1192
1193 <para>
1194 Parse command options
1195 </para>
1196
1197 <para>
1198 <screen>
1199 -a, --alternative Allow long options starting with single -\n"
1200 -l, --longoptions=longopts Long options to be recognized\n"
1201 -n, --name=progname The name under which errors are reported\n"
1202 -o, --options=optstring Short options to be recognized\n"
1203 -q, --quiet Disable error reporting by getopt(3)\n"
1204 -Q, --quiet-output No normal output\n"
1205 -s, --shell=shell Set shell quoting conventions\n"
1206 -T, --test Test for getopt(1) version\n"
1207 -u, --unqote Do not quote the output\n"
1208 </screen>
1209 </para>
1210
1211
1212 <para>
1213 Example:
1214 </para>
1215
1216 <para>
1217 <screen>
1218 $ cat getopt.test
1219 #!/bin/sh
1220 GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \
1221 -n 'example.busybox' -- "$@"`
1222 if [ $? != 0 ] ; then exit 1 ; fi
1223 eval set -- "$GETOPT"
1224 while true ; do
1225 case $1 in
1226 -a|--a-long) echo "Option a" ; shift ;;
1227 -b|--b-long) echo "Option b, argument \`$2'" ; shift 2 ;;
1228 -c|--c-long)
1229 case "$2" in
1230 "") echo "Option c, no argument"; shift 2 ;;
1231 *) echo "Option c, argument \`$2'" ; shift 2 ;;
1232 esac ;;
1233 --) shift ; break ;;
1234 *) echo "Internal error!" ; exit 1 ;;
1235 esac
1236 done
1237 </screen>
1238 </para>
1239 </sect1>
Eric Andersene5cec4e2000-07-06 19:59:22 +00001240
1241 <sect1 id="grep">
1242 <title>grep</title>
1243
1244 <para>
1245 Usage: grep [OPTIONS]... PATTERN [FILE]...
1246 </para>
1247
1248 <para>
1249 Search for PATTERN in each FILE or stdin.
1250 </para>
1251
1252 <para>
1253 Options:
1254 </para>
1255
1256 <para>
1257 <screen>
1258 -h Suppress the prefixing filename on output
1259 -i Ignore case distinctions
1260 -n Print line number with output lines
1261 -q Be quiet. Returns 0 if result was found, 1 otherwise
1262 -v Select non-matching lines
1263 </screen>
1264 </para>
1265
1266 <para>
1267 This version of grep matches full regular expressions.
1268 </para>
1269
1270 <para>
1271 Example:
1272 </para>
1273
1274 <para>
1275 <screen>
1276 $ grep root /etc/passwd
1277 root:x:0:0:root:/root:/bin/bash
1278 $ grep ^[rR]oo. /etc/passwd
1279 root:x:0:0:root:/root:/bin/bash
1280 </screen>
1281 </para>
1282 </sect1>
1283
1284 <sect1 id="gunzip">
1285 <title>gunzip</title>
1286
1287 <para>
1288 Usage: gunzip [OPTION]... FILE
1289 </para>
1290
1291 <para>
1292 Uncompress FILE (or stdin if FILE is '-').
1293 </para>
1294
1295 <para>
1296 Options:
1297 </para>
1298
1299 <para>
1300 <screen>
1301 -c Write output to standard output
1302 -t Test compressed file integrity
1303 </screen>
1304 </para>
1305
1306 <para>
1307 Example:
1308 </para>
1309
1310 <para>
1311 <screen>
1312 $ ls -la /tmp/BusyBox*
1313 -rw-rw-r-- 1 andersen andersen 557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz
1314 $ gunzip /tmp/BusyBox-0.43.tar.gz
1315 $ ls -la /tmp/BusyBox*
1316 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1317 </screen>
1318 </para>
1319 </sect1>
1320
Pavel Roskind2d3aa32000-09-15 17:16:40 +00001321 <sect1 id="gzip">
Eric Andersene5cec4e2000-07-06 19:59:22 +00001322 <title>gzip</title>
1323
1324 <para>
1325 Usage: gzip [OPTION]... FILE
1326 </para>
1327
1328 <para>
1329 Compress FILE (or stdin if FILE is '-') with maximum
1330 compression to FILE.gz (or stdout if FILE is '-').
1331 </para>
1332
1333 <para>
1334 Options:
1335 </para>
1336
1337 <para>
1338 <screen>
1339 -c Write output to standard output
Eric Andersend0fa0a12000-12-13 17:59:37 +00001340 -d decompress
Eric Andersene5cec4e2000-07-06 19:59:22 +00001341 </screen>
1342 </para>
1343
1344 <para>
1345 Example:
1346 </para>
1347
1348 <para>
1349 <screen>
1350 $ ls -la /tmp/BusyBox*
1351 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
1352 $ gzip /tmp/BusyBox-0.43.tar
1353 $ ls -la /tmp/BusyBox*
1354 -rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/BusyBox-0.43.tar.gz
1355 </screen>
1356 </para>
1357 </sect1>
1358
1359 <sect1 id="halt">
1360 <title>halt</title>
1361
1362 <para>
1363 Usage: halt
1364 </para>
1365
1366 <para>
1367 Halt the system.
1368 </para>
1369 </sect1>
1370
1371 <sect1 id="head">
1372 <title>head</title>
1373
1374 <para>
1375 Usage: head [OPTION] FILE...
1376 </para>
1377
1378 <para>
1379 Print first 10 lines of each FILE to standard output.
1380 With more than one FILE, precede each with a header
1381 giving the file name. With no FILE, or when FILE is -,
1382 read standard input.
1383 </para>
1384
1385 <para>
1386 Options:
1387 </para>
1388
1389 <para>
1390 <screen>
1391 -n NUM Print first NUM lines instead of first 10
1392 </screen>
1393 </para>
1394
1395 <para>
1396 Example:
1397 </para>
1398
1399 <para>
1400 <screen>
1401 $ head -n 2 /etc/passwd
1402 root:x:0:0:root:/root:/bin/bash
1403 daemon:x:1:1:daemon:/usr/sbin:/bin/sh
1404 </screen>
1405 </para>
1406 </sect1>
1407
1408 <sect1 id="hostid">
1409 <title>hostid</title>
1410
1411 <para>
1412 Usage: hostid
1413 </para>
1414
1415 <para>
1416 Prints out a unique 32-bit identifier for the current
1417 machine. The 32-bit identifier is intended to be unique
1418 among all UNIX systems in existence.
1419 </para>
1420 </sect1>
1421
1422 <sect1 id="hostname">
1423 <title>hostname</title>
1424
1425 <para>
1426 Usage: hostname [OPTION]... [HOSTNAME|-F FILE]
1427 </para>
1428
1429 <para>
1430 Get or set the hostname or DNS domain name. If a
1431 hostname is given (or a file with the -F parameter), the
1432 host name will be set.
1433 </para>
1434
1435 <para>
1436 Options:
1437 </para>
1438
1439 <para>
1440 <screen>
Eric Andersen0d5835a2000-10-12 22:30:31 +00001441 -s Short
1442 -i Addresses for the hostname
1443 -d DNS domain name
1444 -F, --file FILE Use the contents of FILE to specify the hostname
Eric Andersene5cec4e2000-07-06 19:59:22 +00001445 </screen>
1446 </para>
1447
1448 <para>
1449 Example:
1450 </para>
1451
1452 <para>
1453 <screen>
1454 $ hostname
1455 slag
1456 </screen>
1457 </para>
1458 </sect1>
1459
1460 <sect1 id="id">
1461 <title>id</title>
1462
1463 <para>
1464 Usage: id [OPTION]... [USERNAME]
1465 </para>
1466
1467 <para>
1468 Print information for USERNAME or the current user.
1469 </para>
1470
1471 <para>
1472 Options:
1473 </para>
1474
1475 <para>
1476 <screen>
1477 -g Print only the group ID
1478 -u Print only the user ID
Eric Andersenc1b8f122001-01-25 05:12:02 +00001479 -n print a name instead of a number (with for -ug)
Eric Andersene5cec4e2000-07-06 19:59:22 +00001480 -r Print the real user ID instead of the effective ID (with -ug)
1481 </screen>
1482 </para>
1483
1484 <para>
1485 Example:
1486 </para>
1487
1488 <para>
1489 <screen>
1490 $ id
1491 uid=1000(andersen) gid=1000(andersen)
1492 </screen>
1493 </para>
1494 </sect1>
1495
1496 <sect1 id="init">
1497 <title>init</title>
1498
1499 <para>
1500 Usage: init
1501 </para>
1502
1503 <para>
1504 Init is the parent of all processes.
1505 </para>
1506
1507 <para>
1508 This version of init is designed to be run only by the
1509 kernel.
1510 </para>
1511
1512 <para>
1513 BusyBox init doesn't support multiple runlevels. The
1514 runlevels field of the /etc/inittab file is completely
1515 ignored by BusyBox init. If you want runlevels, use
1516 sysvinit.
1517 </para>
1518
1519 <para>
1520 BusyBox init works just fine without an inittab. If no
1521 inittab is found, it has the following default behavior:
1522 </para>
1523
1524 <para>
1525 <screen>
1526 ::sysinit:/etc/init.d/rcS
1527 ::askfirst:/bin/sh
1528 </screen>
1529 </para>
1530
1531 <para>
1532 If it detects that /dev/console is _not_ a serial
1533 console, it will also run:
1534 </para>
1535
1536 <para>
1537 <screen>
1538 tty2::askfirst:/bin/sh
1539 </screen>
1540 </para>
1541
1542 <para>
1543 If you choose to use an /etc/inittab file, the inittab
1544 entry format is as follows:
1545 </para>
1546
1547 <para>
1548 <screen>
1549 &lt;id&gt;:&lt;runlevels&gt;:&lt;action&gt;:&lt;process&gt;
1550 </screen>
Pavel Roskind2d3aa32000-09-15 17:16:40 +00001551 </para>
Eric Andersene5cec4e2000-07-06 19:59:22 +00001552
1553 <sect2>
1554 <title>id</title>
1555 <para>
Eric Andersen0d2acb02000-12-18 20:36:02 +00001556
1557 WARNING: This field has a non-traditional meaning for BusyBox init!
1558 The id field is used by BusyBox init to specify the controlling tty
1559 for the specified process to run on. The contents of this field
1560 are appended to "/dev/" and used as-is. There is no need for this
1561 field to be unique, although if it isn't you may have strange
1562 results. If this field is left blank, the controlling tty is set
1563 to the console. Also note that if BusyBox detects that a serial
1564 console is in use, then only entries whose controlling tty is
1565 either the serial console or /dev/null will be run. BusyBox init
1566 does nothing with utmp. We don't need no stinkin' utmp.
1567
Eric Andersene5cec4e2000-07-06 19:59:22 +00001568 </para>
1569 </sect2>
1570
1571 <sect2>
1572 <title>runlevels</title>
1573
1574 <para>
1575 The runlevels field is completely ignored.
1576 </para>
1577 </sect2>
1578
1579 <sect2>
1580 <title>action</title>
1581
Eric Anderseneb4218d2000-12-08 20:38:00 +00001582
Eric Andersene5cec4e2000-07-06 19:59:22 +00001583 <para>
Eric Anderseneb4218d2000-12-08 20:38:00 +00001584 Valid actions include: sysinit, respawn, askfirst, wait,
1585 once, and ctrlaltdel.
1586 </para>
1587
1588
1589 <para>
1590 The available actions can be classified into two groups: actions
1591 that are run only once, and actions that are re-run when the specified
1592 process exits.
Eric Andersene5cec4e2000-07-06 19:59:22 +00001593 </para>
1594
1595 <para>
Eric Anderseneb4218d2000-12-08 20:38:00 +00001596 Run only-once actions:
Eric Andersene5cec4e2000-07-06 19:59:22 +00001597 </para>
1598
1599 <para>
Eric Anderseneb4218d2000-12-08 20:38:00 +00001600 'sysinit' is the first item run on boot. init waits until all
1601 sysinit actions are completed before continuing. Following the
1602 completion of all sysinit actions, all 'wait' actions are run.
1603 'wait' actions, like 'sysinit' actions, cause init to wait until
1604 the specified task completes. 'once' actions are asyncronous,
1605 therefore, init does not wait for them to complete. 'ctrlaltdel'
1606 actions are run immediately before init causes the system to reboot
1607 (unmounting filesystems with a 'ctrlaltdel' action is a very good
1608 idea).
Eric Andersene5cec4e2000-07-06 19:59:22 +00001609 </para>
Eric Anderseneb4218d2000-12-08 20:38:00 +00001610
1611 <para>
1612 Run repeatedly actions:
1613 </para>
1614
1615 <para>
1616 'respawn' actions are run after the 'once' actions. When a process
1617 started with a 'respawn' action exits, init automatically restarts
1618 it. Unlike sysvinit, BusyBox init does not stop processes from
1619 respawning out of control. The 'askfirst' actions acts just like
1620 respawn, except that before running the specified process it
1621 displays the line "Please press Enter to activate this console."
1622 and then waits for the user to press enter before starting the
1623 specified process.
1624 </para>
1625
1626 <para>
1627 Unrecognized actions (like initdefault) will cause init to emit an
1628 error message, and then go along with its business. All actions are
1629 run in the reverse order from how they appear in /etc/inittab.
1630 </para>
1631
Eric Andersene5cec4e2000-07-06 19:59:22 +00001632 </sect2>
1633
1634 <sect2>
1635 <title>process</title>
1636
1637 <para>
1638 Specifies the process to be executed and its
1639 command line.
1640 </para>
1641 </sect2>
1642
Pavel Roskind2d3aa32000-09-15 17:16:40 +00001643 <sect2>
1644 <title>Example /etc/inittab file</title>
Eric Andersene5cec4e2000-07-06 19:59:22 +00001645
Eric Andersen57f83ff2000-09-24 02:41:44 +00001646 <para>
1647 <screen>
1648 # This is run first except when booting in single-user mode.
1649 #
1650 ::sysinit:/etc/init.d/rcS
Eric Andersene5cec4e2000-07-06 19:59:22 +00001651
Eric Andersen57f83ff2000-09-24 02:41:44 +00001652 # /bin/sh invocations on selected ttys
1653 #
1654 # Start an "askfirst" shell on the console (whatever that may be)
1655 ::askfirst:-/bin/sh
1656 # Start an "askfirst" shell on /dev/tty2-4
1657 tty2::askfirst:-/bin/sh
1658 tty2::askfirst:-/bin/sh
1659 tty2::askfirst:-/bin/sh
Eric Andersene5cec4e2000-07-06 19:59:22 +00001660
Eric Andersen57f83ff2000-09-24 02:41:44 +00001661 # /sbin/getty invocations for selected ttys
1662 #
1663 tty4::respawn:/sbin/getty 38400 tty5
1664 tty5::respawn:/sbin/getty 38400 tty6
Eric Andersene5cec4e2000-07-06 19:59:22 +00001665
Eric Andersen57f83ff2000-09-24 02:41:44 +00001666 # Example of how to put a getty on a serial line (for a terminal)
1667 #
Eric Andersen8ce85ce2000-09-26 22:20:06 +00001668 #::respawn:/sbin/getty -L ttyS0 9600 vt100
1669 #::respawn:/sbin/getty -L ttyS1 9600 vt100
Eric Andersen57f83ff2000-09-24 02:41:44 +00001670 #
1671 # Example how to put a getty on a modem line.
Eric Andersen8ce85ce2000-09-26 22:20:06 +00001672 #::respawn:/sbin/getty 57600 ttyS2
Eric Andersene5cec4e2000-07-06 19:59:22 +00001673
Eric Andersen57f83ff2000-09-24 02:41:44 +00001674 # Stuff to do before rebooting
1675 ::ctrlaltdel:/bin/umount -a -r
1676 ::ctrlaltdel:/sbin/swapoff
1677 </screen>
1678 </para>
Pavel Roskind2d3aa32000-09-15 17:16:40 +00001679 </sect2>
Eric Andersene5cec4e2000-07-06 19:59:22 +00001680 </sect1>
1681
1682 <sect1 id="insmod">
1683 <title>insmod</title>
1684
1685 <para>
1686 Usage: insmod [OPTION]... MODULE [symbol=value]...
1687 </para>
1688
1689 <para>
Eric Andersen21580922000-07-07 19:07:47 +00001690 Load MODULE into the kernel.
Eric Andersene5cec4e2000-07-06 19:59:22 +00001691 </para>
1692
1693 <para>
1694 Options:
1695 </para>
1696
1697 <para>
1698 <screen>
1699 -f Force module to load into the wrong kernel version.
1700 -k Make module autoclean-able.
1701 -v Verbose output
1702 -x Do not export externs
Eric Andersen8c5cb312001-01-24 19:15:07 +00001703 -L Prevent simultaneous loads of the same module
Eric Andersene5cec4e2000-07-06 19:59:22 +00001704 </screen>
1705 </para>
1706 </sect1>
1707
1708 <sect1 id="kill">
1709 <title>kill</title>
1710
1711 <para>
1712 Usage: kill [OPTION] PID...
1713 </para>
1714
1715 <para>
1716 Send a signal (default is SIGTERM) to the specified
1717 PID(s).
1718 </para>
1719
1720 <para>
1721 Options:
1722 </para>
1723
1724 <para>
1725 <screen>
1726 -l List all signal names and numbers
1727 -SIG Send signal SIG
1728 </screen>
1729 </para>
1730
1731 <para>
1732 Example:
1733 </para>
1734
1735 <para>
1736 <screen>
1737 $ ps | grep apache
1738 252 root root S [apache]
1739 263 www-data www-data S [apache]
1740 264 www-data www-data S [apache]
1741 265 www-data www-data S [apache]
1742 266 www-data www-data S [apache]
1743 267 www-data www-data S [apache]
1744 $ kill 252
1745 </screen>
1746 </para>
1747 </sect1>
1748
1749 <sect1 id="killall">
1750 <title>killall</title>
1751
1752 <para>
1753 Usage: killall [OPTION] NAME...
1754 </para>
1755
1756 <para>
1757 Send a signal (default is SIGTERM) to the specified
1758 NAME(s).
1759 </para>
1760
1761 <para>
1762 Options:
1763 </para>
1764
1765 <para>
1766 <screen>
1767 -l List all signal names and numbers
1768 -SIG Send signal SIG
1769 </screen>
1770 </para>
1771
1772 <para>
1773 Example:
1774 </para>
1775
1776 <para>
1777 <screen>
1778 $ killall apache
1779 </screen>
1780 </para>
1781 </sect1>
1782
1783 <sect1 id="length">
1784 <title>length</title>
1785
1786 <para>
1787 Usage: length STRING
1788 </para>
1789
1790 <para>
1791 Print the length of STRING.
1792 </para>
1793
1794 <para>
1795 Example:
1796 </para>
1797
1798 <para>
1799 <screen>
1800 $ length "Hello"
1801 5
1802 </screen>
1803 </para>
1804 </sect1>
1805
1806 <sect1 id="ln">
1807 <title>ln</title>
1808
1809 <para>
1810 Usage: ln [OPTION]... TARGET FILE|DIRECTORY
1811 </para>
1812
1813 <para>
1814 Create a link named FILE or DIRECTORY to the specified
1815 TARGET. You may use '--' to indicate that all following
1816 arguments are non-options.
1817 </para>
1818
1819 <para>
1820 Options:
1821 </para>
1822
1823 <para>
1824 <screen>
1825 -s Make symbolic link instead of hard link
1826 -f Remove existing destination file
1827 </screen>
1828 </para>
1829
1830 <para>
1831 Example:
1832 </para>
1833
1834 <para>
1835 <screen>
1836 $ ln -s BusyBox /tmp/ls
1837 $ ls -l /tmp/ls
1838 lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -&gt; BusyBox*
1839 </screen>
1840 </para>
1841 </sect1>
1842
1843 <sect1 id="loadacm">
1844 <title>loadacm</title>
1845
1846 <para>
1847 Usage: loadacm
1848 </para>
1849
1850 <para>
1851 Load an acm from stdin.
1852 </para>
1853
1854 <para>
1855 Example:
1856 </para>
1857
1858 <para>
1859 <screen>
1860 $ loadacm &lt; /etc/i18n/acmname
1861 </screen>
1862 </para>
1863 </sect1>
1864
1865 <sect1 id="loadfont">
1866 <title>loadfont</title>
1867
1868 <para>
1869 Usage: loadfont
1870 </para>
1871
1872 <para>
1873 Load a console font from stdin.
1874 </para>
1875
1876 <para>
1877 Example:
1878 </para>
1879
1880 <para>
1881 <screen>
1882 $ loadfont &lt; /etc/i18n/fontname
1883 </screen>
1884 </para>
1885 </sect1>
1886
1887 <sect1 id="loadkmap">
1888 <title>loadkmap</title>
1889
1890 <para>
1891 Usage: loadkmap
1892 </para>
1893
1894 <para>
1895 Load a binary keyboard translation table from stdin.
1896 </para>
1897
1898 <para>
1899 Example:
1900 </para>
1901
1902 <para>
1903 <screen>
1904 $ loadkmap &lt; /etc/i18n/lang-keymap
1905 </screen>
1906 </para>
1907 </sect1>
1908
1909 <sect1 id="logger">
1910 <title>logger</title>
1911
1912 <para>
1913 Usage: logger [OPTION]... [MESSAGE]
1914 </para>
1915
1916 <para>
Matt Kraai004827d2001-01-02 22:54:12 +00001917 Write MESSAGE to the system log. If MESSAGE is omitted, log
Eric Andersene5cec4e2000-07-06 19:59:22 +00001918 stdin.
1919 </para>
1920
1921 <para>
1922 Options:
1923 </para>
1924
1925 <para>
1926 <screen>
1927 -s Log to stderr as well as the system log
1928 -t Log using the specified tag (defaults to user name)
1929 -p Enter the message with the specified priority
1930 This may be numerical or a ``facility.level'' pair
1931 </screen>
1932 </para>
1933
1934 <para>
1935 Example:
1936 </para>
1937
1938 <para>
1939 <screen>
1940 $ logger "hello"
1941 </screen>
1942 </para>
1943 </sect1>
1944
1945 <sect1 id="logname">
1946 <title>logname</title>
1947
1948 <para>
1949 Usage: logname
1950 </para>
1951
1952 <para>
1953 Print the name of the current user.
1954 </para>
1955
1956 <para>
1957 Example:
1958 </para>
1959
1960 <para>
1961 <screen>
1962 $ logname
1963 root
1964 </screen>
1965 </para>
1966 </sect1>
1967
1968 <sect1 id="ls">
1969 <title>ls</title>
1970
1971 <para>
1972 Usage: ls [OPTION]... [FILE]...
1973 </para>
1974
1975 <para>
1976
1977 </para>
1978
1979 <para>
1980 Options:
1981 </para>
1982
1983 <para>
1984 <screen>
1985 -a Do not hide entries starting with .
1986 -c With -l: show ctime (the time of last
1987 modification of file status information)
1988 -d List directory entries instead of contents
1989 -e List both full date and full time
1990 -l Use a long listing format
1991 -n List numeric UIDs and GIDs instead of names
1992 -p Append indicator (one of /=@|) to entries
1993 -u With -l: show access time (the time of last
1994 access of the file)
1995 -x List entries by lines instead of by columns
1996 -A Do not list implied . and ..
1997 -C List entries by columns
1998 -F Append indicator (one of */=@|) to entries
Eric Andersen5b176932000-09-22 20:22:28 +00001999 -L list entries pointed to by symbolic links
Eric Andersene5cec4e2000-07-06 19:59:22 +00002000 -R List subdirectories recursively
2001 </screen>
2002 </para>
2003
2004 <para>
2005 Example:
2006 </para>
2007
2008 <para>
2009 <screen>
2010 </screen>
2011 </para>
2012 </sect1>
2013
2014 <sect1 id="lsmod">
2015 <title>lsmod</title>
2016
2017 <para>
2018 Usage: lsmod
2019 </para>
2020
2021 <para>
2022 List currently loaded kernel modules.
2023 </para>
2024 </sect1>
2025
2026 <sect1 id="makedevs">
2027 <title>makedevs</title>
2028
2029 <para>
2030 Usage: makedevsf NAME TYPE MAJOR MINOR FIRST LAST [s]
2031 </para>
2032
2033 <para>
2034 Create a range of block or character special files.
2035 </para>
2036
2037 <para>
2038 TYPE may be:
2039 </para>
2040
2041 <para>
2042 <screen>
2043 b Make a block (buffered) device
2044 c or u Make a character (un-buffered) device
2045 p Make a named pipe. MAJOR and MINOR are ignored for named pipes
2046 </screen>
2047 </para>
2048
2049 <para>
2050 FIRST specifies the number appended to NAME to create
2051 the first device. LAST specifies the number of the last
2052 item that should be created. If 's' is the last
2053 argument, the base device is created as well.
2054 </para>
2055
2056 <para>
2057 Example:
2058 </para>
2059
2060 <para>
2061 <screen>
2062 $ makedevs /dev/ttyS c 4 66 2 63
2063 [creates ttyS2-ttyS63]
2064 $ makedevs /dev/hda b 3 0 0 8 s
2065 [creates hda,hda1-hda8]
2066 </screen>
2067 </para>
2068 </sect1>
2069
Eric Andersenb9eb0232000-07-07 05:04:24 +00002070 <sect1 id="md5sum">
2071 <title>md5sum</title>
2072
2073 <para>
2074 Usage: md5sum [OPTION]... FILE...
2075 </para>
2076
2077 <para>
2078 Print or check MD5 checksums.
2079 </para>
2080
2081 <para>
2082 Options:
2083 </para>
2084
2085 <para>
2086 <screen>
2087 -b Read files in binary mode
2088 -c Check MD5 sums against given list
2089 -t Read files in text mode (default)
2090 -g Read a string
2091 </screen>
2092 </para>
2093
2094 <para>
2095 The following two options are useful only when verifying
2096 checksums:
2097 </para>
2098
2099 <para>
2100 <screen>
2101 -s Don't output anything, status code shows success
2102 -w Warn about improperly formated MD5 checksum lines
2103 </screen>
2104 </para>
2105
2106 <para>
2107 Example:
2108 </para>
2109
2110 <para>
2111 <screen>
2112 $ md5sum busybox
2113 6fd11e98b98a58f64ff3398d7b324003 busybox
2114 $ md5sum -c
2115 6fd11e98b98a58f64ff3398d7b324003 busybox
2116 6fd11e98b98a58f64ff3398d7b324002 busybox
2117 md5sum: MD5 check failed for 'busybox'
2118 ^D
2119 </screen>
2120 </para>
2121 </sect1>
2122
2123 <sect1 id="mkdir">
2124 <title>mkdir</title>
2125
2126 <para>
2127 Usage: mkdir [OPTION]... DIRECTORY...
2128 </para>
2129
2130 <para>
2131 Create the DIRECTORY(s), if they do not already exist.
2132 </para>
2133
2134 <para>
2135 Options:
2136 </para>
2137
2138 <para>
2139 <screen>
2140 -m Set permission mode (as in chmod), not rwxrwxrwx - umask
2141 -p No error if directory exists, make parent directories as needed
2142 </screen>
2143 </para>
2144
2145 <para>
2146 Example:
2147 </para>
2148
2149 <para>
2150 <screen>
2151 $ mkdir /tmp/foo
2152 $ mkdir /tmp/foo
2153 /tmp/foo: File exists
2154 $ mkdir /tmp/foo/bar/baz
2155 /tmp/foo/bar/baz: No such file or directory
2156 $ mkdir -p /tmp/foo/bar/baz
2157 </screen>
2158 </para>
2159 </sect1>
2160
2161 <sect1 id="mkfifo">
2162 <title>mkfifo</title>
2163
2164 <para>
2165 Usage: mkfifo [OPTION] NAME
2166 </para>
2167
2168 <para>
2169 Create a named pipe (identical to 'mknod NAME p').
2170 </para>
2171
2172 <para>
2173 Options:
2174 </para>
2175
2176 <para>
2177 <screen>
2178 -m MODE Create the pipe using the specified mode (default a=rw)
2179 </screen>
2180 </para>
2181 </sect1>
2182
2183 <sect1 id="mkfs.minix">
2184 <title>mkfs.minix</title>
2185
2186 <para>
2187 Usage: mkfs.minix [OPTION]... NAME [BLOCKS]
2188 </para>
2189
2190 <para>
2191 Make a MINIX filesystem.
2192 </para>
2193
2194 <para>
2195 Options:
2196 </para>
2197
2198 <para>
2199 <screen>
2200 -c Check the device for bad blocks
2201 -n [14|30] Specify the maximum length of filenames
2202 -i Specify the number of inodes for the filesystem
2203 -l FILENAME Read the bad blocks list from FILENAME
2204 -v Make a Minix version 2 filesystem
2205 </screen>
2206 </para>
2207 </sect1>
2208
2209 <sect1 id="mknod">
2210 <title>mknod</title>
2211
2212 <para>
2213 Usage: mknod [OPTION]... NAME TYPE MAJOR MINOR
2214 </para>
2215
2216 <para>
2217 Create a special file (block, character, or pipe).
2218 </para>
2219
2220 <para>
2221 Options:
2222 </para>
2223
2224 <para>
2225 <screen>
2226 -m Create the special file using the specified mode (default a=rw)
2227 </screen>
2228 </para>
2229
2230 <para>
2231 TYPE may be:
2232 </para>
2233
2234 <para>
2235 <screen>
2236 b Make a block (buffered) device
2237 c or u Make a character (un-buffered) device
2238 p Make a named pipe. MAJOR and MINOR are ignored for named pipes
2239 </screen>
2240 </para>
2241
2242 <para>
2243 Example:
2244 </para>
2245
2246 <para>
2247 <screen>
2248 $ mknod /dev/fd0 b 2 0
2249 $ mknod -m 644 /tmp/pipe p
2250 </screen>
2251 </para>
2252 </sect1>
2253
2254 <sect1 id="mkswap">
2255 <title>mkswap</title>
2256
2257 <para>
2258 Usage: mkswap [OPTION]... DEVICE [BLOCKS]
2259 </para>
2260
2261 <para>
2262 Prepare a disk partition to be used as a swap partition.
2263 </para>
2264
2265 <para>
2266 Options:
2267 </para>
2268
2269 <para>
2270 <screen>
2271 -c Check for read-ability.
2272 -v0 Make version 0 swap [max 128 Megs].
2273 -v1 Make version 1 swap [big!] (default for kernels &gt; 2.1.117).
2274 BLOCKS Number of block to use (default is entire partition).
2275 </screen>
2276 </para>
2277 </sect1>
2278
2279 <sect1 id="mktemp">
2280 <title>mktemp</title>
2281
2282 <para>
2283 Usage: mktemp TEMPLATE
2284 </para>
2285
2286 <para>
2287 Creates a temporary file with its name based on
2288 TEMPLATE. TEMPLATE is any name with six `Xs' (i.e.
2289 /tmp/temp.XXXXXX).
2290 </para>
2291
2292 <para>
2293 Example:
2294 </para>
2295
2296 <para>
2297 <screen>
2298 $ mktemp /tmp/temp.XXXXXX
2299 /tmp/temp.mWiLjM
2300 $ ls -la /tmp/temp.mWiLjM
2301 -rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM
2302 </screen>
2303 </para>
2304 </sect1>
2305
2306 <sect1 id="more">
2307 <title>more</title>
2308
2309 <para>
2310 Usage: more [FILE]...
2311 </para>
2312
2313 <para>
2314 Page through text one screenful at a time.
2315 </para>
2316
2317 <para>
2318 Example:
2319 </para>
2320
2321 <para>
2322 <screen>
2323 $ dmesg | more
2324 </screen>
2325 </para>
2326 </sect1>
2327
2328 <sect1 id="mount">
2329 <title>mount</title>
2330
2331 <para>
2332 Usage: mount [OPTION]...
2333 </para>
2334
2335 <para>
2336 <screen>
2337 or: mount [OPTION]... DEVICE DIRECTORY
2338 </screen>
2339 </para>
2340
2341 <para>
2342 Mount filesystems.
2343 </para>
2344
2345 <para>
2346 Options:
2347 </para>
2348
2349 <para>
2350 <screen>
2351 -a Mount all filesystems in /etc/fstab
2352 -o One of the many filesystem options listed below
2353 -r Mount the filesystem read-only
2354 -t TYPE Specify the filesystem type
2355 -w Mount the filesystem read-write
2356 </screen>
2357 </para>
2358
2359 <para>
2360 Options for use with the -o flag:
2361 </para>
2362
2363 <para>
2364 <screen>
2365 async/sync Writes are asynchronous / synchronous
2366 atime/noatime Enable / disable updates to inode access times
2367 dev/nodev Allow / disallow use of special device files
2368 exec/noexec Allow / disallow use of executable files
2369 loop Mount a file via loop device
2370 suid/nosuid Allow / disallow set-user-id-root programs
2371 remount Remount a currently mounted filesystem
2372 ro/rw Mount filesystem read-only / read-write
2373 </screen>
2374 </para>
2375
2376 <para>
2377 There are even more flags that are filesystem specific.
2378 You'll have to see the written documentation for those.
2379 </para>
2380
2381 <para>
2382 Example:
2383 </para>
2384
2385 <para>
2386 <screen>
2387 $ mount
2388 /dev/hda3 on / type minix (rw)
2389 proc on /proc type proc (rw)
2390 devpts on /dev/pts type devpts (rw)
2391 $ mount /dev/fd0 /mnt -t msdos -o ro
2392 $ mount /tmp/diskimage /opt -t ext2 -o loop
2393 </screen>
2394 </para>
2395 </sect1>
2396
2397 <sect1 id="mt">
2398 <title>mt</title>
2399
2400 <para>
2401 Usage: mt [OPTION] OPCODE VALUE
2402 </para>
2403
2404 <para>
2405 Control magnetic tape drive operation.
2406 </para>
2407
2408 <para>
2409 Options:
2410 </para>
2411
2412 <para>
2413 <screen>
2414 -f DEVICE Control DEVICE
2415 </screen>
2416 </para>
2417 </sect1>
2418
2419 <sect1 id="mv">
2420 <title>mv</title>
2421
2422 <para>
2423 Usage: mv SOURCE DEST
2424 </para>
2425
2426 <para>
2427 <screen>
2428 or: mv SOURCE... DIRECTORY
2429 </screen>
2430 </para>
2431
2432 <para>
2433 Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
2434 </para>
2435
2436 <para>
2437 Example:
2438 </para>
2439
2440 <para>
2441 <screen>
2442 $ mv /tmp/foo /bin/bar
2443 </screen>
2444 </para>
2445 </sect1>
2446
2447 <sect1 id="nc">
2448 <title>nc</title>
2449
2450 <para>
2451 Usage: nc HOST PORT
2452 </para>
2453
2454 <para>
Matt Kraai1d702672001-02-07 04:09:23 +00002455 or: nc -p PORT -l
2456 </para>
2457
2458
2459 <para>
2460 Open a pipe to HOST:PORT or listen for a connection on PORT.
Eric Andersenb9eb0232000-07-07 05:04:24 +00002461 </para>
2462
2463 <para>
2464 Example:
2465 </para>
2466
2467 <para>
2468 <screen>
2469 $ nc foobar.somedomain.com 25
2470 220 foobar ESMTP Exim 3.12 #1 Sat, 15 Apr 2000 00:03:02 -0600
2471 help
2472 214-Commands supported:
2473 214- HELO EHLO MAIL RCPT DATA AUTH
2474 214 NOOP QUIT RSET HELP
2475 quit
2476 221 foobar closing connection
2477 </screen>
2478 </para>
2479 </sect1>
2480
2481 <sect1 id="nslookup">
2482 <title>nslookup</title>
2483
2484 <para>
2485 Usage: nslookup [HOST]
2486 </para>
2487
2488 <para>
2489 Query the nameserver for the IP address of the given
2490 HOST.
2491 </para>
2492
2493 <para>
2494 Example:
2495 </para>
2496
2497 <para>
2498 <screen>
2499 $ nslookup localhost
2500 Server: default
2501 Address: default
2502
2503 Name: debian
2504 Address: 127.0.0.1
2505 </screen>
2506 </para>
2507 </sect1>
2508
2509 <sect1 id="ping">
2510 <title>ping</title>
2511
2512 <para>
2513 Usage: ping [OPTION]... HOST
2514 </para>
2515
2516 <para>
2517 Send ICMP ECHO_REQUEST packets to HOST.
2518 </para>
2519
2520 <para>
2521 Options:
2522 </para>
2523
2524 <para>
2525 <screen>
2526 -c COUNT Send only COUNT pings
2527 -s SIZE Send SIZE data bytes in packets (default=56)
2528 -q Quiet mode, only displays output at start and when finished
2529 </screen>
2530 </para>
2531
2532 <para>
2533 Example:
2534 </para>
2535
2536 <para>
2537 <screen>
2538 $ ping localhost
2539 PING slag (127.0.0.1): 56 data bytes
2540 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=20.1 ms
2541
2542 --- debian ping statistics ---
2543 1 packets transmitted, 1 packets received, 0% packet loss
2544 round-trip min/avg/max = 20.1/20.1/20.1 ms
2545 </screen>
2546 </para>
2547 </sect1>
2548
2549 <sect1 id="poweroff">
2550 <title>poweroff</title>
2551
2552 <para>
2553 Usage: poweroff
2554 </para>
2555
2556 <para>
2557 Shut down the system, and request that the kernel turn
2558 off power upon halting.
2559 </para>
2560 </sect1>
2561
2562 <sect1 id="printf">
2563 <title>printf</title>
2564
2565 <para>
2566 Usage: printf FORMAT [ARGUMENT]...
2567 </para>
2568
2569 <para>
2570 Format and print the given data in a manner similar to
2571 the C printf command.
2572 </para>
2573
2574 <para>
2575 Example:
2576 </para>
2577
2578 <para>
2579 <screen>
2580 $ printf "Val=%d\n" 5
2581 Val=5
2582 </screen>
2583 </para>
2584 </sect1>
2585
Eric Andersen21580922000-07-07 19:07:47 +00002586 <sect1 id="ps">
2587 <title>ps</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002588
Eric Andersen21580922000-07-07 19:07:47 +00002589 <para>
2590 Usage: ps
2591 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002592
Eric Andersen21580922000-07-07 19:07:47 +00002593 <para>
2594 Report process status. This version of ps accepts no
2595 options.
2596 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002597
Eric Andersen21580922000-07-07 19:07:47 +00002598 <para>
2599 Options:
2600 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002601
Eric Andersen21580922000-07-07 19:07:47 +00002602 <para>
2603 <screen>
2604 </screen>
2605 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002606
Eric Andersen21580922000-07-07 19:07:47 +00002607 <para>
2608 Example:
2609 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002610
Eric Andersen21580922000-07-07 19:07:47 +00002611 <para>
2612 <screen>
2613 $ ps
2614 PID Uid Gid State Command
2615 1 root root S init
2616 2 root root S [kflushd]
2617 3 root root S [kupdate]
2618 4 root root S [kpiod]
2619 5 root root S [kswapd]
2620 742 andersen andersen S [bash]
2621 743 andersen andersen S -bash
2622 745 root root S [getty]
2623 2990 andersen andersen R ps
2624 </screen>
2625 </para>
2626 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002627
Eric Andersen21580922000-07-07 19:07:47 +00002628 <sect1 id="pwd">
2629 <title>pwd</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002630
Eric Andersen21580922000-07-07 19:07:47 +00002631 <para>
2632 Usage: pwd
2633 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002634
Eric Andersen21580922000-07-07 19:07:47 +00002635 <para>
2636 Print the full filename of the current working
2637 directory.
2638 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002639
Eric Andersen21580922000-07-07 19:07:47 +00002640 <para>
2641 Example:
2642 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002643
Eric Andersen21580922000-07-07 19:07:47 +00002644 <para>
2645 <screen>
2646 $ pwd
2647 /root
2648 </screen>
2649 </para>
2650 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002651
Eric Andersen918507e2000-08-21 22:46:33 +00002652 <sect1 id="rdate">
2653 <title>rdate</title>
2654
2655 <para>
2656 Usage: rdate [OPTION] HOST
2657 </para>
2658
2659 <para>
2660 Get and possibly set the system date and time from a remote HOST.
2661 </para>
2662
2663 <para>
2664 Options:
2665 </para>
2666
2667 <para>
2668 <screen>
2669 -s Set the system date and time (default).
2670 -p Print the date and time.
2671 </screen>
2672 </para>
2673 </sect1>
2674
Eric Andersen21580922000-07-07 19:07:47 +00002675 <sect1 id="reboot">
2676 <title>reboot</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002677
Eric Andersen21580922000-07-07 19:07:47 +00002678 <para>
2679 Usage: reboot
2680 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002681
Eric Andersen21580922000-07-07 19:07:47 +00002682 <para>
2683 Reboot the system.
2684 </para>
2685 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002686
Eric Andersenbf960f52000-07-21 21:32:12 +00002687 <sect1 id="renice">
2688 <title>renice</title>
2689
2690 <para>
2691 Usage: renice priority pid [pid ...]
2692 </para>
2693
2694 <para>
2695 Changes priority of running processes. Allowed priorities range
2696 from 20 (the process runs only when nothing else is running) to 0
2697 (default priority) to -20 (almost nothing else ever gets to run).
2698 </para>
2699 </sect1>
2700
Eric Andersenfa405d02000-08-21 21:18:52 +00002701 <sect1 id="reset">
2702 <title>reset</title>
2703
2704 <para>
2705 Usage: reset
2706 </para>
2707
2708 <para>
2709 Resets the screen.
2710 </para>
2711 </sect1>
2712
Eric Andersen21580922000-07-07 19:07:47 +00002713 <sect1 id="rm">
2714 <title>rm</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002715
Eric Andersen21580922000-07-07 19:07:47 +00002716 <para>
2717 Usage: rm [OPTION]... FILE...
2718 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002719
Eric Andersen21580922000-07-07 19:07:47 +00002720 <para>
2721 Remove (unlink) the FILE(s). You may use '--' to
2722 indicate that all following arguments are non-options.
2723 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002724
Eric Andersen21580922000-07-07 19:07:47 +00002725 <para>
2726 Options:
2727 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002728
Eric Andersen21580922000-07-07 19:07:47 +00002729 <para>
2730 <screen>
2731 -f Remove existing destinations, never prompt
2732 -r or -R Remove the contents of directories recursively
2733 </screen>
2734 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002735
Eric Andersen21580922000-07-07 19:07:47 +00002736 <para>
2737 Example:
2738 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002739
Eric Andersen21580922000-07-07 19:07:47 +00002740 <para>
2741 <screen>
2742 $ rm -rf /tmp/foo
2743 </screen>
2744 </para>
2745 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002746
Eric Andersen21580922000-07-07 19:07:47 +00002747 <sect1 id="rmdir">
2748 <title>rmdir</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002749
Eric Andersen21580922000-07-07 19:07:47 +00002750 <para>
2751 Usage: rmdir DIRECTORY...
2752 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002753
Eric Andersen21580922000-07-07 19:07:47 +00002754 <para>
2755 Remove DIRECTORY(s) if they are empty.
2756 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002757
Eric Andersen21580922000-07-07 19:07:47 +00002758 <para>
2759 Example:
2760 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002761
Eric Andersen21580922000-07-07 19:07:47 +00002762 <para>
2763 <screen>
2764 $ rmdir /tmp/foo
2765 </screen>
2766 </para>
2767 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002768
Eric Andersen21580922000-07-07 19:07:47 +00002769 <sect1 id="rmmod">
2770 <title>rmmod</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002771
Eric Andersen21580922000-07-07 19:07:47 +00002772 <para>
2773 Usage: rmmod [OPTION]... [MODULE]...
2774 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002775
Eric Andersen21580922000-07-07 19:07:47 +00002776 <para>
2777 Unload MODULE(s) from the kernel.
2778 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002779
Eric Andersen21580922000-07-07 19:07:47 +00002780 <para>
2781 Options:
2782 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002783
Eric Andersen21580922000-07-07 19:07:47 +00002784 <para>
2785 <screen>
2786 -a Try to remove all unused kernel modules
2787 </screen>
2788 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002789
Eric Andersen21580922000-07-07 19:07:47 +00002790 <para>
2791 Example:
2792 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002793
Eric Andersen21580922000-07-07 19:07:47 +00002794 <para>
2795 <screen>
2796 $ rmmod tulip
2797 </screen>
2798 </para>
2799 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002800
Eric Andersen21580922000-07-07 19:07:47 +00002801 <sect1 id="sed">
2802 <title>sed</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002803
Eric Andersen21580922000-07-07 19:07:47 +00002804 <para>
2805 Usage: sed [OPTION]... SCRIPT [FILE]...
2806 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002807
Eric Andersen21580922000-07-07 19:07:47 +00002808 <para>
2809 Allowed sed scripts come in the following form:
2810 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002811
Eric Andersen21580922000-07-07 19:07:47 +00002812 <para>
2813 <screen>
2814 ADDR [!] COMMAND
2815 </screen>
2816 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002817
Eric Andersen21580922000-07-07 19:07:47 +00002818 <para>
2819 ADDR can be:
2820 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002821
Eric Andersen21580922000-07-07 19:07:47 +00002822 <para>
2823 <screen>
2824 NUMBER Match specified line number
2825 $ Match last line
2826 /REGEXP/ Match specified regexp
2827 </screen>
2828 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002829
Eric Andersen21580922000-07-07 19:07:47 +00002830 <para>
2831 ! inverts the meaning of the match
2832 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002833
Eric Andersen21580922000-07-07 19:07:47 +00002834 <para>
2835 COMMAND can be:
2836 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002837
Eric Andersen21580922000-07-07 19:07:47 +00002838 <para>
2839 <screen>
2840 s/regexp/replacement/[igp]
2841 which attempt to match regexp against the pattern space
2842 and if successful replaces the matched portion with replacement.
2843 aTEXT
2844 which appends TEXT after the pattern space
2845 </screen>
2846 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002847
Eric Andersen21580922000-07-07 19:07:47 +00002848 <para>
2849 This version of sed matches full regular expressions.
2850 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002851
Eric Andersen21580922000-07-07 19:07:47 +00002852 <para>
2853 Options:
2854 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002855
Eric Andersen21580922000-07-07 19:07:47 +00002856 <para>
2857 <screen>
2858 -e Add the script to the commands to be executed
2859 -n Suppress automatic printing of pattern space
2860 </screen>
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 $ echo "foo" | sed -e 's/f[a-zA-Z]o/bar/g'
2870 bar
2871 </screen>
2872 </para>
2873 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002874
Eric Andersen21580922000-07-07 19:07:47 +00002875 <sect1 id="setkeycodes">
2876 <title>setkeycodes</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002877
Eric Andersen21580922000-07-07 19:07:47 +00002878 <para>
2879 Usage: setkeycodes SCANCODE KEYCODE ...
2880 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002881
Eric Andersen21580922000-07-07 19:07:47 +00002882 <para>
2883 Set entries into the kernel's scancode-to-keycode map,
2884 allowing unusual keyboards to generate usable keycodes.
2885 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002886
Eric Andersen21580922000-07-07 19:07:47 +00002887 <para>
2888 SCANCODE may be either xx or e0xx (hexadecimal), and
2889 KEYCODE is given in decimal.
2890 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002891
Eric Andersen21580922000-07-07 19:07:47 +00002892 <para>
2893 Example:
2894 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002895
Eric Andersen21580922000-07-07 19:07:47 +00002896 <para>
2897 <screen>
2898 $ setkeycodes e030 127
2899 </screen>
2900 </para>
2901 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002902
Mark Whitley83a949c2000-06-26 13:31:53 +00002903
Eric Andersen21580922000-07-07 19:07:47 +00002904 <sect1 id="sh">
2905 <title>sh</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002906
Eric Andersen21580922000-07-07 19:07:47 +00002907 <para>
2908 Usage: sh
2909 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002910
Eric Andersen21580922000-07-07 19:07:47 +00002911 <para>
2912 lash -- the BusyBox LAme SHell (command interpreter)
2913 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002914
Eric Andersen21580922000-07-07 19:07:47 +00002915 <para>
2916 This command does not yet have proper documentation.
2917 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002918
Eric Andersen21580922000-07-07 19:07:47 +00002919 <para>
2920 Use lash just as you would use any other shell. It
2921 properly handles pipes, redirects, job control, can be
2922 used as the shell for scripts (#!/bin/sh), and has a
2923 sufficient set of builtins to do what is needed. It does
2924 not (yet) support Bourne Shell syntax. If you need
2925 things like ``if-then-else'', ``while'', and such, use
2926 ash or bash. If you just need a very simple and
2927 extremely small shell, this will do the job.
2928 </para>
2929 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002930
Eric Andersen21580922000-07-07 19:07:47 +00002931 <sect1 id="sleep">
2932 <title>sleep</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002933
Eric Andersen21580922000-07-07 19:07:47 +00002934 <para>
2935 Usage: sleep N
2936 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002937
Eric Andersen21580922000-07-07 19:07:47 +00002938 <para>
2939 Pause for N seconds.
2940 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002941
Eric Andersen21580922000-07-07 19:07:47 +00002942 <para>
2943 Example:
2944 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002945
Eric Andersen21580922000-07-07 19:07:47 +00002946 <para>
2947 <screen>
2948 $ sleep 2
2949 [2 second delay results]
2950 </screen>
2951 </para>
2952 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002953
Eric Andersen21580922000-07-07 19:07:47 +00002954 <sect1 id="sort">
2955 <title>sort</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002956
Eric Andersen21580922000-07-07 19:07:47 +00002957 <para>
2958 Usage: sort [OPTION]... [FILE]...
2959 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002960
Eric Andersen21580922000-07-07 19:07:47 +00002961 <para>
2962 Sort lines of text in FILE(s).
2963 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002964
Eric Andersen21580922000-07-07 19:07:47 +00002965 <para>
2966 Options:
2967 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002968
Eric Andersen21580922000-07-07 19:07:47 +00002969 <para>
2970 <screen>
2971 -n Compare numerically
2972 -r Reverse after sorting
2973 </screen>
2974 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002975
Eric Andersen21580922000-07-07 19:07:47 +00002976 <para>
2977 Example:
2978 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002979
Eric Andersen21580922000-07-07 19:07:47 +00002980 <para>
2981 <screen>
2982 $ echo -e "e\nf\nb\nd\nc\na" | sort
2983 a
2984 b
2985 c
2986 d
2987 e
2988 f
2989 </screen>
2990 </para>
2991 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002992
Eric Andersen21580922000-07-07 19:07:47 +00002993 <sect1 id="swapoff">
2994 <title>swapoff</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002995
Eric Andersen21580922000-07-07 19:07:47 +00002996 <para>
2997 Usage: swapoff [OPTION] [DEVICE]
2998 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002999
Eric Andersen21580922000-07-07 19:07:47 +00003000 <para>
3001 Stop swapping virtual memory pages on DEVICE.
3002 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003003
Eric Andersen21580922000-07-07 19:07:47 +00003004 <para>
3005 Options:
3006 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003007
Eric Andersen21580922000-07-07 19:07:47 +00003008 <para>
3009 <screen>
3010 -a Stop swapping on all swap devices
3011 </screen>
3012 </para>
3013 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003014
Eric Andersen21580922000-07-07 19:07:47 +00003015 <sect1 id="swapon">
3016 <title>swapon</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003017
Eric Andersen21580922000-07-07 19:07:47 +00003018 <para>
3019 Usage: swapon [OPTION] [DEVICE]
3020 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003021
Eric Andersen21580922000-07-07 19:07:47 +00003022 <para>
3023 Start swapping virtual memory pages on the given device.
3024 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003025
Eric Andersen21580922000-07-07 19:07:47 +00003026 <para>
3027 Options:
3028 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003029
Eric Andersen21580922000-07-07 19:07:47 +00003030 <para>
3031 <screen>
3032 -a Start swapping on all swap devices
3033 </screen>
3034 </para>
3035 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003036
Eric Andersen21580922000-07-07 19:07:47 +00003037 <sect1 id="sync">
3038 <title>sync</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003039
Eric Andersen21580922000-07-07 19:07:47 +00003040 <para>
3041 Usage: sync
3042 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003043
Eric Andersen21580922000-07-07 19:07:47 +00003044 <para>
3045 Write all buffered filesystem blocks to disk.
3046 </para>
3047 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003048
Eric Andersen21580922000-07-07 19:07:47 +00003049 <sect1 id="syslogd">
3050 <title>syslogd</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003051
Eric Andersen21580922000-07-07 19:07:47 +00003052 <para>
3053 Usage: syslogd [OPTION]...
3054 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003055
Eric Andersen21580922000-07-07 19:07:47 +00003056 <para>
3057 Linux system and kernel (provides klogd) logging
3058 utility. Note that this version of syslogd/klogd ignores
3059 /etc/syslog.conf.
3060 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003061
Eric Andersen21580922000-07-07 19:07:47 +00003062 <para>
3063 Options:
3064 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003065
Eric Andersen21580922000-07-07 19:07:47 +00003066 <para>
3067 <screen>
3068 -m NUM Interval between MARK lines (default=20min, 0=off)
3069 -n Run as a foreground process
3070 -K Do not start up the klogd process
3071 -O FILE Use an alternate log file (default=/var/log/messages)
Eric Andersen70d09ed2000-12-11 16:24:16 +00003072 -R HOST[:PORT] Log remotely to IP or hostname on PORT (default PORT=514/UDP)
Eric Andersen20c2bdd2000-12-11 19:39:25 +00003073 -L Log locally as well as network logging (default is network only)
Eric Andersen21580922000-07-07 19:07:47 +00003074 </screen>
3075 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003076
Eric Andersen21580922000-07-07 19:07:47 +00003077 <para>
3078 Example:
3079 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003080
Eric Andersen21580922000-07-07 19:07:47 +00003081 <para>
3082 <screen>
Eric Andersenced2cef2000-07-20 23:41:24 +00003083 $ syslogd -R masterlog:514
3084 $ syslogd -R 192.168.1.1:601
Eric Andersen21580922000-07-07 19:07:47 +00003085 </screen>
3086 </para>
3087 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003088
Eric Andersen21580922000-07-07 19:07:47 +00003089 <sect1 id="tail">
3090 <title>tail</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003091
Eric Andersen21580922000-07-07 19:07:47 +00003092 <para>
3093 Usage: tail [OPTION] [FILE]...
3094 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003095
Eric Andersen21580922000-07-07 19:07:47 +00003096 <para>
3097 Print last 10 lines of each FILE to standard output.
3098 With more than one FILE, precede each with a header
3099 giving the file name. With no FILE, or when FILE is -,
3100 read stdin.
3101 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003102
Eric Andersen21580922000-07-07 19:07:47 +00003103 <para>
3104 Options:
3105 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003106
Eric Andersen21580922000-07-07 19:07:47 +00003107 <para>
3108 <screen>
3109 -n NUM Print last NUM lines instead of last 10
3110 -f Output data as the file grows. This version
3111 of 'tail -f' supports only one file at a time.
3112 </screen>
3113 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003114
Eric Andersen21580922000-07-07 19:07:47 +00003115 <para>
3116 Example:
3117 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003118
Eric Andersen21580922000-07-07 19:07:47 +00003119 <para>
3120 <screen>
3121 $ tail -n 1 /etc/resolv.conf
3122 nameserver 10.0.0.1
3123 </screen>
3124 </para>
3125 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003126
Eric Andersen21580922000-07-07 19:07:47 +00003127 <sect1 id="tar">
3128 <title>tar</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003129
Eric Andersen21580922000-07-07 19:07:47 +00003130 <para>
3131 Usage: tar [MODE] [OPTION] [FILE]...
3132 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003133
Eric Andersen21580922000-07-07 19:07:47 +00003134 <para>
3135
3136 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003137
Eric Andersen21580922000-07-07 19:07:47 +00003138 <para>
3139 MODE may be chosen from
3140 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003141
Eric Andersen21580922000-07-07 19:07:47 +00003142 <para>
3143 <screen>
3144 c Create
3145 x Extract
3146 t List
3147 </screen>
3148 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003149
Eric Andersen21580922000-07-07 19:07:47 +00003150 <para>
3151 Options:
3152 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003153
Eric Andersen21580922000-07-07 19:07:47 +00003154 <para>
3155 <screen>
Eric Andersenfdd51032000-08-02 18:48:26 +00003156 f FILE Use FILE for tarfile (or stdin if '-')
3157 O Extract to stdout
3158 exclude FILE File to exclude
3159 v List files processed
Eric Andersen21580922000-07-07 19:07:47 +00003160 </screen>
3161 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003162
Eric Andersen21580922000-07-07 19:07:47 +00003163 <para>
3164 Example:
3165 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003166
Eric Andersen21580922000-07-07 19:07:47 +00003167 <para>
3168 <screen>
3169 $ zcat /tmp/tarball.tar.gz | tar -xf -
3170 $ tar -cf /tmp/tarball.tar /usr/local
3171 </screen>
3172 </para>
3173 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003174
Eric Andersen21580922000-07-07 19:07:47 +00003175 <sect1 id="tee">
3176 <title>tee</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003177
Eric Andersen21580922000-07-07 19:07:47 +00003178 <para>
3179 Usage: tee [OPTION]... [FILE]...
3180 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003181
Eric Andersen21580922000-07-07 19:07:47 +00003182 <para>
3183 Copy stdin to FILE(s), and also to stdout.
3184 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003185
Eric Andersen21580922000-07-07 19:07:47 +00003186 <para>
3187 Options:
3188 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003189
Eric Andersen21580922000-07-07 19:07:47 +00003190 <para>
3191 <screen>
3192 -a Append to the given FILEs, do not overwrite
3193 </screen>
3194 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003195
Eric Andersen21580922000-07-07 19:07:47 +00003196 <para>
3197 Example:
3198 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003199
Eric Andersen21580922000-07-07 19:07:47 +00003200 <para>
3201 <screen>
3202 $ echo "Hello" | tee /tmp/foo
3203 Hello
3204 $ cat /tmp/foo
3205 Hello
3206 </screen>
3207 </para>
3208 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003209
Eric Andersen21580922000-07-07 19:07:47 +00003210 <sect1 id="telnet">
3211 <title>telnet</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003212
Eric Andersen21580922000-07-07 19:07:47 +00003213 <para>
3214 Usage: telnet HOST [PORT]
3215 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003216
Eric Andersen21580922000-07-07 19:07:47 +00003217 <para>
3218 Establish interactive communication with another
3219 computer over a network using the TELNET protocol.
3220 </para>
3221 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003222
Eric Andersen21580922000-07-07 19:07:47 +00003223 <sect1 id="test">
3224 <title>test, [</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003225
Eric Andersen21580922000-07-07 19:07:47 +00003226 <para>
3227 Usage: test EXPRESSION
3228 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003229
Eric Andersen21580922000-07-07 19:07:47 +00003230 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003231 or: [ EXPRESSION ]
Pavel Roskind2d3aa32000-09-15 17:16:40 +00003232 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003233
Eric Andersen21580922000-07-07 19:07:47 +00003234 <para>
3235 Check file types and compare values returning an exit
3236 code determined by the value of EXPRESSION.
3237 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003238
Eric Andersen21580922000-07-07 19:07:47 +00003239 <para>
3240 Example:
3241 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003242
Eric Andersen21580922000-07-07 19:07:47 +00003243 <para>
3244 <screen>
3245 $ test 1 -eq 2
3246 $ echo $?
3247 1
3248 $ test 1 -eq 1
3249 $ echo $?
3250 0
3251 $ [ -d /etc ]
3252 $ echo $?
3253 0
3254 $ [ -d /junk ]
3255 $ echo $?
3256 1
3257 </screen>
3258 </para>
3259 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003260
Eric Andersen21580922000-07-07 19:07:47 +00003261 <sect1 id="touch">
3262 <title>touch</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003263
Eric Andersen21580922000-07-07 19:07:47 +00003264 <para>
3265 Usage: touch [OPTION]... FILE...
3266 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003267
Eric Andersen21580922000-07-07 19:07:47 +00003268 <para>
3269 Update the last-modified date on (or create) FILE(s).
3270 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003271
Eric Andersen21580922000-07-07 19:07:47 +00003272 <para>
3273 Options:
3274 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003275
Eric Andersen21580922000-07-07 19:07:47 +00003276 <para>
3277 <screen>
3278 -c Do not create files
3279 </screen>
3280 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003281
Eric Andersen21580922000-07-07 19:07:47 +00003282 <para>
3283 Example:
3284 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003285
Eric Andersen21580922000-07-07 19:07:47 +00003286 <para>
3287 <screen>
3288 $ ls -l /tmp/foo
3289 /bin/ls: /tmp/foo: No such file or directory
3290 $ touch /tmp/foo
3291 $ ls -l /tmp/foo
3292 -rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo
3293 </screen>
3294 </para>
3295 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003296
Eric Andersen21580922000-07-07 19:07:47 +00003297 <sect1 id="tr">
3298 <title>tr</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003299
Eric Andersen21580922000-07-07 19:07:47 +00003300 <para>
3301 Usage: tr [OPTION]... STRING1 [STRING2]
3302 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003303
Eric Andersen21580922000-07-07 19:07:47 +00003304 <para>
3305 Translate, squeeze, and/or delete characters from stdin,
3306 writing to stdout.
3307 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003308
Eric Andersen21580922000-07-07 19:07:47 +00003309 <para>
3310 Options:
3311 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003312
Eric Andersen21580922000-07-07 19:07:47 +00003313 <para>
3314 <screen>
3315 -c Take complement of STRING1
3316 -d Delete input characters coded STRING1
3317 -s Squeeze multiple output characters of STRING2 into one character
3318 </screen>
3319 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003320
Eric Andersen21580922000-07-07 19:07:47 +00003321 <para>
3322 Example:
3323 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003324
Eric Andersen21580922000-07-07 19:07:47 +00003325 <para>
3326 <screen>
3327 $ echo "gdkkn vnqkc" | tr [a-y] [b-z]
3328 hello world
3329 </screen>
3330 </para>
3331 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003332
Eric Andersen21580922000-07-07 19:07:47 +00003333 <sect1 id="true">
3334 <title>true</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003335
Eric Andersen21580922000-07-07 19:07:47 +00003336 <para>
3337 Usage: true
3338 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003339
Eric Andersen21580922000-07-07 19:07:47 +00003340 <para>
3341 Return an exit code of TRUE (1).
3342 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003343
Eric Andersen21580922000-07-07 19:07:47 +00003344 <para>
3345 Example:
3346 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003347
Eric Andersen21580922000-07-07 19:07:47 +00003348 <para>
3349 <screen>
3350 $ true
3351 $ echo $?
3352 0
3353 </screen>
3354 </para>
3355 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003356
Eric Andersen21580922000-07-07 19:07:47 +00003357 <sect1 id="tty">
3358 <title>tty</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003359
Eric Andersen21580922000-07-07 19:07:47 +00003360 <para>
3361 Usage: tty
3362 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003363
Eric Andersen21580922000-07-07 19:07:47 +00003364 <para>
3365 Print the file name of the terminal connected to stdin.
3366 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003367
Eric Andersen21580922000-07-07 19:07:47 +00003368 <para>
3369 Options:
3370 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003371
Eric Andersen21580922000-07-07 19:07:47 +00003372 <para>
3373 <screen>
3374 -s Print nothing, only return an exit status
3375 </screen>
3376 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003377
Eric Andersen21580922000-07-07 19:07:47 +00003378 <para>
3379 Example:
3380 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003381
Eric Andersen21580922000-07-07 19:07:47 +00003382 <para>
3383 <screen>
3384 $ tty
3385 /dev/tty2
3386 </screen>
3387 </para>
3388 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003389
Eric Andersen21580922000-07-07 19:07:47 +00003390 <sect1 id="umount">
3391 <title>umount</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003392
Eric Andersen21580922000-07-07 19:07:47 +00003393 <para>
3394 Usage: umount [OPTION]... DEVICE|DIRECTORY
3395 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003396
Eric Andersen21580922000-07-07 19:07:47 +00003397 <para>
3398
3399 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003400
Eric Andersen21580922000-07-07 19:07:47 +00003401 <para>
3402 Options:
3403 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003404
Eric Andersen21580922000-07-07 19:07:47 +00003405 <para>
3406 <screen>
3407 -a Unmount all file systems
3408 -r Try to remount devices as read-only if mount is busy
3409 -f Force filesystem umount (i.e. unreachable NFS server)
3410 -l Do not free loop device (if a loop device has been used)
3411 </screen>
3412 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003413
Eric Andersen21580922000-07-07 19:07:47 +00003414 <para>
3415 Example:
3416 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003417
Eric Andersen21580922000-07-07 19:07:47 +00003418 <para>
3419 <screen>
3420 $ umount /dev/hdc1
3421 </screen>
3422 </para>
3423 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003424
Eric Andersen21580922000-07-07 19:07:47 +00003425 <sect1 id="uname">
3426 <title>uname</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003427
Eric Andersen21580922000-07-07 19:07:47 +00003428 <para>
3429 Usage: uname [OPTION]...
3430 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003431
Eric Andersen21580922000-07-07 19:07:47 +00003432 <para>
3433 Print certain system information. With no OPTION, same
3434 as -s.
3435 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003436
Eric Andersen21580922000-07-07 19:07:47 +00003437 <para>
3438 Options:
3439 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003440
Eric Andersen21580922000-07-07 19:07:47 +00003441 <para>
3442 <screen>
3443 -a Print all information
3444 -m Print the machine (hardware) type
3445 -n Print the machine's network node hostname
3446 -r Print the operating system release
3447 -s Print the operating system name
3448 -p Print the host processor type
3449 -v Print the operating system version
3450 </screen>
3451 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003452
Eric Andersen21580922000-07-07 19:07:47 +00003453 <para>
3454 Example:
3455 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003456
Eric Andersen21580922000-07-07 19:07:47 +00003457 <para>
3458 <screen>
3459 $ uname -a
3460 Linux debian 2.2.15pre13 #5 Tue Mar 14 16:03:50 MST 2000 i686 unknown
3461 </screen>
3462 </para>
3463 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003464
Eric Andersen21580922000-07-07 19:07:47 +00003465 <sect1 id="uniq">
3466 <title>uniq</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003467
Eric Andersen21580922000-07-07 19:07:47 +00003468 <para>
3469 Usage: uniq [INPUT [OUTPUT]]
3470 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003471
Eric Andersen21580922000-07-07 19:07:47 +00003472 <para>
3473 Discard all but one of successive identical lines from
3474 INPUT (or stdin), writing to OUTPUT (or stdout).
3475 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003476
Eric Andersen21580922000-07-07 19:07:47 +00003477 <para>
Eric Andersen5b5db382000-12-09 16:37:53 +00003478 Options:
3479 </para>
3480
3481 <para>
3482 <screen>
3483 -c prefix lines by the number of occurrences
3484 -d only print duplicate lines
3485 -u only print unique lines
3486 </screen>
3487 </para>
3488
3489 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003490 Example:
3491 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003492
Eric Andersen21580922000-07-07 19:07:47 +00003493 <para>
3494 <screen>
3495 $ echo -e "a\na\nb\nc\nc\na" | sort | uniq
3496 a
3497 b
3498 c
3499 </screen>
3500 </para>
3501 </sect1>
Eric Andersencff3fe32000-09-20 19:22:26 +00003502
3503 <sect1 id="unix2dos">
3504 <title>unix2dos</title>
3505
3506 <para>
3507 Usage: unix2dos < unixfile > dosfile
3508 </para>
3509
3510 <para>
3511 Converts a text file from unix format to dos format.
3512 </para>
3513
3514 </sect1>
3515
3516 <sect1 id="unrpm">
Eric Andersen57f83ff2000-09-24 02:41:44 +00003517 <title>unrpm</title>
Eric Andersencff3fe32000-09-20 19:22:26 +00003518
3519 <para>
3520 Usage: unrpm < package.rpm | gzip -d | cpio -idmuv
3521 </para>
3522
3523 <para>
3524 Extracts an rpm archive.
3525 </para>
3526
3527 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003528
Eric Andersen21580922000-07-07 19:07:47 +00003529 <sect1 id="update">
3530 <title>update</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003531
Eric Andersen21580922000-07-07 19:07:47 +00003532 <para>
3533 Usage: update [OPTION]...
3534 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003535
Eric Andersen21580922000-07-07 19:07:47 +00003536 <para>
3537 Periodically flush filesystem buffers.
3538 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003539
Eric Andersen21580922000-07-07 19:07:47 +00003540 <para>
3541 Options:
3542 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003543
Eric Andersen21580922000-07-07 19:07:47 +00003544 <para>
3545 <screen>
3546 -S Force use of sync(2) instead of flushing
3547 -s SECS Call sync this often (default 30)
3548 -f SECS Flush some buffers this often (default 5)
3549 </screen>
3550 </para>
3551 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003552
Eric Andersen21580922000-07-07 19:07:47 +00003553 <sect1 id="uptime">
3554 <title>uptime</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003555
Eric Andersen21580922000-07-07 19:07:47 +00003556 <para>
3557 Usage: uptime
3558 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003559
Eric Andersen21580922000-07-07 19:07:47 +00003560 <para>
3561 Display how long the system has been running since boot.
3562 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003563
Eric Andersen21580922000-07-07 19:07:47 +00003564 <para>
3565 Example:
3566 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003567
Eric Andersen21580922000-07-07 19:07:47 +00003568 <para>
3569 <screen>
3570 $ uptime
3571 1:55pm up 2:30, load average: 0.09, 0.04, 0.00
3572 </screen>
3573 </para>
3574 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003575
Eric Andersen21580922000-07-07 19:07:47 +00003576 <sect1 id="usleep">
3577 <title>usleep</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003578
Eric Andersen21580922000-07-07 19:07:47 +00003579 <para>
3580 Usage: usleep N
3581 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003582
Eric Andersen21580922000-07-07 19:07:47 +00003583 <para>
3584 Pause for N microseconds.
3585 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003586
Eric Andersen21580922000-07-07 19:07:47 +00003587 <para>
3588 Example:
3589 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003590
Eric Andersen21580922000-07-07 19:07:47 +00003591 <para>
3592 <screen>
3593 $ usleep 1000000
3594 [pauses for 1 second]
3595 </screen>
3596 </para>
3597 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003598
Eric Andersen21580922000-07-07 19:07:47 +00003599 <sect1 id="uudecode">
3600 <title>uudecode</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003601
Eric Andersen21580922000-07-07 19:07:47 +00003602 <para>
3603 Usage: uudecode [OPTION] [FILE]
3604 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003605
Eric Andersen21580922000-07-07 19:07:47 +00003606 <para>
3607 Uudecode a uuencoded file.
3608 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003609
Eric Andersen21580922000-07-07 19:07:47 +00003610 <para>
3611 Options:
3612 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003613
Eric Andersen21580922000-07-07 19:07:47 +00003614 <para>
3615 <screen>
3616 -o FILE Direct output to FILE
3617 </screen>
3618 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003619
Eric Andersen21580922000-07-07 19:07:47 +00003620 <para>
3621 Example:
3622 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003623
Eric Andersen21580922000-07-07 19:07:47 +00003624 <para>
3625 <screen>
3626 $ uudecode -o busybox busybox.uu
3627 $ ls -l busybox
3628 -rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox
3629 </screen>
3630 </para>
3631 </sect1>
Eric Andersen028fb622000-07-04 20:07:13 +00003632
Eric Andersen21580922000-07-07 19:07:47 +00003633 <sect1 id="uuencode">
3634 <title>uuencode</title>
Eric Andersen028fb622000-07-04 20:07:13 +00003635
Eric Andersen21580922000-07-07 19:07:47 +00003636 <para>
3637 Usage: uuencode [OPTION] [INFILE] OUTFILE
3638 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003639
Eric Andersen21580922000-07-07 19:07:47 +00003640 <para>
3641 Uuencode a file.
3642 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003643
Eric Andersen21580922000-07-07 19:07:47 +00003644 <para>
3645 Options:
3646 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003647
Eric Andersen21580922000-07-07 19:07:47 +00003648 <para>
3649 <screen>
3650 -m Use base64 encoding as of RFC1521
3651 </screen>
3652 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003653
Eric Andersen21580922000-07-07 19:07:47 +00003654 <para>
3655 Example:
3656 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003657
Eric Andersen21580922000-07-07 19:07:47 +00003658 <para>
3659 <screen>
3660 $ uuencode busybox busybox
3661 begin 755 busybox
3662 M?T5,1@$!`0````````````(``P`!````L+@$"#0```!0N@,``````#0`(``&amp;
3663 .....
3664 $ uudecode busybox busybox &gt; busybox.uu
3665 $
3666 </screen>
3667 </para>
3668 </sect1>
Eric Andersen028fb622000-07-04 20:07:13 +00003669
Eric Andersenffde8672001-01-25 23:40:32 +00003670 <sect1 id="watchdog">
3671 <title>watchdog</title>
3672
3673 <para>
3674 Usage: watchdog device
3675 </para>
3676
3677 <para>
3678 Periodically writes to watchdog device B<device>.
3679 </para>
3680 </sect1>
3681
Eric Andersen21580922000-07-07 19:07:47 +00003682 <sect1 id="wc">
3683 <title>wc</title>
Eric Andersen028fb622000-07-04 20:07:13 +00003684
Eric Andersen21580922000-07-07 19:07:47 +00003685 <para>
3686 Usage: wc [OPTION]... [FILE]...
3687 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003688
Eric Andersen21580922000-07-07 19:07:47 +00003689 <para>
3690 Print line, word, and byte counts for each FILE, and a
3691 total line if more than one FILE is specified. With no
3692 FILE, read stdin.
3693 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003694
Eric Andersen21580922000-07-07 19:07:47 +00003695 <para>
3696 Options:
3697 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003698
Eric Andersen21580922000-07-07 19:07:47 +00003699 <para>
3700 <screen>
3701 -c Print the byte counts
3702 -l Print the newline counts
3703 -L Print the length of the longest line
3704 -w Print the word counts
3705 </screen>
3706 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003707
Eric Andersen21580922000-07-07 19:07:47 +00003708 <para>
3709 Example:
3710 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003711
Eric Andersen21580922000-07-07 19:07:47 +00003712 <para>
3713 <screen>
3714 $ wc /etc/passwd
3715 31 46 1365 /etc/passwd
3716 </screen>
3717 </para>
3718 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003719
Eric Andersen21580922000-07-07 19:07:47 +00003720 <sect1 id="which">
3721 <title>which</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003722
Eric Andersen21580922000-07-07 19:07:47 +00003723 <para>
3724 Usage: which [COMMAND]...
3725 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003726
Eric Andersen21580922000-07-07 19:07:47 +00003727 <para>
3728 Locate COMMAND(s).
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 $ which login
3738 /bin/login
3739 </screen>
3740 </para>
3741 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003742
Eric Andersen21580922000-07-07 19:07:47 +00003743 <sect1 id="whoami">
3744 <title>whoami</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003745
Eric Andersen21580922000-07-07 19:07:47 +00003746 <para>
3747 Usage: whoami
3748 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003749
Eric Andersen21580922000-07-07 19:07:47 +00003750 <para>
3751 Print the user name associated with the current
3752 effective user id.
3753 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003754
Eric Andersen21580922000-07-07 19:07:47 +00003755 <para>
3756 Example:
3757 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003758
Eric Andersen21580922000-07-07 19:07:47 +00003759 <para>
3760 <screen>
3761 $ whoami
3762 andersen
3763 </screen>
3764 </para>
3765 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003766
Eric Andersen5b176932000-09-22 20:22:28 +00003767 <sect1 id="xargs">
3768 <title>xargs</title>
3769
3770 <para>
3771 Usage: xargs [OPTIONS] [COMMAND] [ARGS...]
3772 </para>
3773
3774 <para>
3775 Executes COMMAND on every item given by standard input.
3776 </para>
3777
3778 <para>
3779 Options:
3780 </para>
3781
3782 <para>
3783 <screen>
3784 -t Print the command just before it is run
Eric Andersen5b176932000-09-22 20:22:28 +00003785 </screen>
3786 </para>
3787
3788
3789 <para>
3790 Example:
3791 </para>
3792
3793 <para>
3794 <screen>
3795 $ ls | xargs gzip
3796 $ find . -name '*.c' -print | xargs rm
3797 </screen>
3798 </para>
3799 </sect1>
3800
Eric Andersen21580922000-07-07 19:07:47 +00003801 <sect1 id="yes">
3802 <title>yes</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003803
Eric Andersen21580922000-07-07 19:07:47 +00003804 <para>
3805 Usage: yes [STRING]...
3806 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003807
Eric Andersen21580922000-07-07 19:07:47 +00003808 <para>
3809 Repeatedly output a line with all specified STRING(s),
3810 or `y'.
3811 </para>
3812 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003813
Eric Andersen21580922000-07-07 19:07:47 +00003814 <sect1 id="zcat">
3815 <title>zcat</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003816
Eric Andersen21580922000-07-07 19:07:47 +00003817 <para>
3818 Usage: zcat [OPTION]... FILE
3819 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003820
Eric Andersen21580922000-07-07 19:07:47 +00003821 <para>
3822 Uncompress FILE (or stdin if FILE is '-') to stdout.
3823 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003824
Eric Andersen21580922000-07-07 19:07:47 +00003825 <para>
3826 Options:
3827 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003828
Eric Andersen21580922000-07-07 19:07:47 +00003829 <para>
3830 <screen>
3831 -t Test compressed file integrity
3832 </screen>
3833 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003834
Eric Andersen21580922000-07-07 19:07:47 +00003835 <para>
3836 Example:
3837 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003838
Eric Andersen21580922000-07-07 19:07:47 +00003839 <para>
3840 <screen>
3841 </screen>
3842 </para>
3843 </sect1>
3844 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +00003845
Eric Andersen21580922000-07-07 19:07:47 +00003846 <chapter id="LIBC-NSS">
3847 <title>LIBC NSS</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003848
Eric Andersen21580922000-07-07 19:07:47 +00003849 <para>
3850 GNU Libc uses the Name Service Switch (NSS) to configure the
3851 behavior of the C library for the local environment, and to
3852 configure how it reads system data, such as passwords and group
3853 information. BusyBox has made it Policy that it will never use
3854 NSS, and will never use libc calls that make use of NSS. This
3855 allows you to run an embedded system without the need for
3856 installing an /etc/nsswitch.conf file and without /lib/libnss_*
3857 libraries installed.
3858 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003859
Eric Andersen21580922000-07-07 19:07:47 +00003860 <para>
3861 If you are using a system that is using a remote LDAP server for
3862 authentication via GNU libc NSS, and you want to use BusyBox,
3863 then you will need to adjust the BusyBox source. Chances are
3864 though, that if you have enough space to install of that stuff
3865 on your system, then you probably want the full GNU utilities.
3866 </para>
3867 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +00003868
Eric Andersen21580922000-07-07 19:07:47 +00003869 <chapter id="SEE-ALSO">
3870 <title>SEE ALSO</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003871
Eric Andersen21580922000-07-07 19:07:47 +00003872 <para>
3873 <literal>textutils(1),</literal>
3874 <literal>shellutils(1),</literal>
3875 etc...
3876 </para>
3877 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +00003878
Eric Andersen21580922000-07-07 19:07:47 +00003879 <chapter id="MAINTAINER">
3880 <title>MAINTAINER</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003881
Eric Andersen21580922000-07-07 19:07:47 +00003882 <para>
3883 Erik Andersen &lt;andersee@debian.org&gt; &lt;andersen@lineo.com&gt;
3884 </para>
3885 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +00003886
Eric Andersen21580922000-07-07 19:07:47 +00003887 <chapter id="AUTHORS">
3888 <title>AUTHORS</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003889
Eric Andersen21580922000-07-07 19:07:47 +00003890 <para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003891 The following people have made significant contributions to
3892 BusyBox -- whether they know it or not.
Eric Andersen21580922000-07-07 19:07:47 +00003893 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003894
Eric Andersen21580922000-07-07 19:07:47 +00003895 <para>
3896 Erik Andersen &lt;andersee@debian.org&gt;
3897 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003898
Eric Andersen21580922000-07-07 19:07:47 +00003899 <para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003900 Edward Betts &lt;edward@debian.org&gt;
3901 </para>
3902
3903 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003904 John Beppu &lt;beppu@lineo.com&gt;
3905 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003906
Eric Andersen21580922000-07-07 19:07:47 +00003907 <para>
3908 Brian Candler &lt;B.Candler@pobox.com&gt;
3909 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003910
Eric Andersen21580922000-07-07 19:07:47 +00003911 <para>
3912 Randolph Chung &lt;tausq@debian.org&gt;
3913 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003914
Eric Andersen21580922000-07-07 19:07:47 +00003915 <para>
3916 Dave Cinege &lt;dcinege@psychosis.com&gt;
3917 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003918
Eric Andersen21580922000-07-07 19:07:47 +00003919 <para>
3920 Karl M. Hegbloom &lt;karlheg@debian.org&gt;
3921 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003922
Eric Andersen21580922000-07-07 19:07:47 +00003923 <para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003924 Daniel Jacobowitz &lt;dan@debian.org&gt;
3925 </para>
3926
3927 <para>
3928 Matt Kraai &lt;kraai@alumni.carnegiemellon.edu&gt;
3929 </para>
3930
3931 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003932 John Lombardo &lt;john@deltanet.com&gt;
3933 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003934
Eric Andersen21580922000-07-07 19:07:47 +00003935 <para>
3936 Glenn McGrath &lt;bug1@netconnect.com.au&gt;
3937 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003938
Eric Andersen21580922000-07-07 19:07:47 +00003939 <para>
3940 Bruce Perens &lt;bruce@perens.com&gt;
3941 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003942
Eric Andersen21580922000-07-07 19:07:47 +00003943 <para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003944 Chip Rosenthal &lt;chip@unicom.com&gt;, &lt;crosenth@covad.com&gt;
3945 </para>
3946
3947 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003948 Pavel Roskin &lt;proski@gnu.org&gt;
3949 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003950
Eric Andersen21580922000-07-07 19:07:47 +00003951 <para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003952 Gyepi Sam &lt;gyepi@praxis-sw.com&gt;
3953 </para>
3954
3955 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003956 Linus Torvalds &lt;torvalds@transmeta.com&gt;
3957 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003958
John Beppu2aee9932000-09-15 08:04:42 +00003959 <para>
3960 Mark Whitley &lt;markw@lineo.com&gt;
3961 </para>
3962
Eric Andersen21580922000-07-07 19:07:47 +00003963 <para>
3964 Charles P. Wright &lt;cpwright@villagenet.com&gt;
3965 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003966
Eric Andersen21580922000-07-07 19:07:47 +00003967 <para>
3968 Enrique Zanardi &lt;ezanardi@ull.es&gt;
3969 </para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003970
3971
Eric Andersen21580922000-07-07 19:07:47 +00003972 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +00003973</book> <!-- End of the book -->