blob: 2d372506b190a3ccd2591b3c00e22b87f845c0ac [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
Eric Andersen77d92682001-05-23 20:32:09 +0000808 directory. Disk space printed in units of 1k (i.e.,
Eric Andersen6f5e2812000-07-06 16:58:45 +0000809 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
Eric Andersen77d92682001-05-23 20:32:09 +00002288 TEMPLATE. TEMPLATE is any name with six `Xs' (i.e.,
Eric Andersenb9eb0232000-07-07 05:04:24 +00002289 /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>
Mark Whitleye0bf91d2001-03-13 00:40:19 +00002731 -i Always prompt before removing each destinations
Eric Andersen21580922000-07-07 19:07:47 +00002732 -f Remove existing destinations, never prompt
2733 -r or -R Remove the contents of directories recursively
2734 </screen>
2735 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002736
Eric Andersen21580922000-07-07 19:07:47 +00002737 <para>
2738 Example:
2739 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002740
Eric Andersen21580922000-07-07 19:07:47 +00002741 <para>
2742 <screen>
2743 $ rm -rf /tmp/foo
2744 </screen>
2745 </para>
2746 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002747
Eric Andersen21580922000-07-07 19:07:47 +00002748 <sect1 id="rmdir">
2749 <title>rmdir</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002750
Eric Andersen21580922000-07-07 19:07:47 +00002751 <para>
2752 Usage: rmdir DIRECTORY...
2753 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002754
Eric Andersen21580922000-07-07 19:07:47 +00002755 <para>
2756 Remove DIRECTORY(s) if they are empty.
2757 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002758
Eric Andersen21580922000-07-07 19:07:47 +00002759 <para>
2760 Example:
2761 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002762
Eric Andersen21580922000-07-07 19:07:47 +00002763 <para>
2764 <screen>
2765 $ rmdir /tmp/foo
2766 </screen>
2767 </para>
2768 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002769
Eric Andersen21580922000-07-07 19:07:47 +00002770 <sect1 id="rmmod">
2771 <title>rmmod</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002772
Eric Andersen21580922000-07-07 19:07:47 +00002773 <para>
2774 Usage: rmmod [OPTION]... [MODULE]...
2775 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002776
Eric Andersen21580922000-07-07 19:07:47 +00002777 <para>
2778 Unload MODULE(s) from the kernel.
2779 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002780
Eric Andersen21580922000-07-07 19:07:47 +00002781 <para>
2782 Options:
2783 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002784
Eric Andersen21580922000-07-07 19:07:47 +00002785 <para>
2786 <screen>
2787 -a Try to remove all unused kernel modules
2788 </screen>
2789 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002790
Eric Andersen21580922000-07-07 19:07:47 +00002791 <para>
2792 Example:
2793 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002794
Eric Andersen21580922000-07-07 19:07:47 +00002795 <para>
2796 <screen>
2797 $ rmmod tulip
2798 </screen>
2799 </para>
2800 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002801
Eric Andersen21580922000-07-07 19:07:47 +00002802 <sect1 id="sed">
2803 <title>sed</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002804
Eric Andersen21580922000-07-07 19:07:47 +00002805 <para>
2806 Usage: sed [OPTION]... SCRIPT [FILE]...
2807 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002808
Eric Andersen21580922000-07-07 19:07:47 +00002809 <para>
2810 Allowed sed scripts come in the following form:
2811 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002812
Eric Andersen21580922000-07-07 19:07:47 +00002813 <para>
2814 <screen>
2815 ADDR [!] COMMAND
2816 </screen>
2817 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002818
Eric Andersen21580922000-07-07 19:07:47 +00002819 <para>
2820 ADDR can be:
2821 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002822
Eric Andersen21580922000-07-07 19:07:47 +00002823 <para>
2824 <screen>
2825 NUMBER Match specified line number
2826 $ Match last line
2827 /REGEXP/ Match specified regexp
2828 </screen>
2829 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002830
Eric Andersen21580922000-07-07 19:07:47 +00002831 <para>
2832 ! inverts the meaning of the match
2833 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002834
Eric Andersen21580922000-07-07 19:07:47 +00002835 <para>
2836 COMMAND can be:
2837 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002838
Eric Andersen21580922000-07-07 19:07:47 +00002839 <para>
2840 <screen>
2841 s/regexp/replacement/[igp]
2842 which attempt to match regexp against the pattern space
2843 and if successful replaces the matched portion with replacement.
2844 aTEXT
2845 which appends TEXT after the pattern space
2846 </screen>
2847 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002848
Eric Andersen21580922000-07-07 19:07:47 +00002849 <para>
2850 This version of sed matches full regular expressions.
2851 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002852
Eric Andersen21580922000-07-07 19:07:47 +00002853 <para>
2854 Options:
2855 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002856
Eric Andersen21580922000-07-07 19:07:47 +00002857 <para>
2858 <screen>
2859 -e Add the script to the commands to be executed
2860 -n Suppress automatic printing of pattern space
2861 </screen>
2862 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002863
Eric Andersen21580922000-07-07 19:07:47 +00002864 <para>
2865 Example:
2866 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002867
Eric Andersen21580922000-07-07 19:07:47 +00002868 <para>
2869 <screen>
2870 $ echo "foo" | sed -e 's/f[a-zA-Z]o/bar/g'
2871 bar
2872 </screen>
2873 </para>
2874 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002875
Eric Andersen21580922000-07-07 19:07:47 +00002876 <sect1 id="setkeycodes">
2877 <title>setkeycodes</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002878
Eric Andersen21580922000-07-07 19:07:47 +00002879 <para>
2880 Usage: setkeycodes SCANCODE KEYCODE ...
2881 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002882
Eric Andersen21580922000-07-07 19:07:47 +00002883 <para>
2884 Set entries into the kernel's scancode-to-keycode map,
2885 allowing unusual keyboards to generate usable keycodes.
2886 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002887
Eric Andersen21580922000-07-07 19:07:47 +00002888 <para>
2889 SCANCODE may be either xx or e0xx (hexadecimal), and
2890 KEYCODE is given in decimal.
2891 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002892
Eric Andersen21580922000-07-07 19:07:47 +00002893 <para>
2894 Example:
2895 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002896
Eric Andersen21580922000-07-07 19:07:47 +00002897 <para>
2898 <screen>
2899 $ setkeycodes e030 127
2900 </screen>
2901 </para>
2902 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002903
Mark Whitley83a949c2000-06-26 13:31:53 +00002904
Eric Andersen21580922000-07-07 19:07:47 +00002905 <sect1 id="sh">
2906 <title>sh</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002907
Eric Andersen21580922000-07-07 19:07:47 +00002908 <para>
2909 Usage: sh
2910 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002911
Eric Andersen21580922000-07-07 19:07:47 +00002912 <para>
2913 lash -- the BusyBox LAme SHell (command interpreter)
2914 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002915
Eric Andersen21580922000-07-07 19:07:47 +00002916 <para>
2917 This command does not yet have proper documentation.
2918 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002919
Eric Andersen21580922000-07-07 19:07:47 +00002920 <para>
2921 Use lash just as you would use any other shell. It
2922 properly handles pipes, redirects, job control, can be
2923 used as the shell for scripts (#!/bin/sh), and has a
2924 sufficient set of builtins to do what is needed. It does
2925 not (yet) support Bourne Shell syntax. If you need
2926 things like ``if-then-else'', ``while'', and such, use
2927 ash or bash. If you just need a very simple and
2928 extremely small shell, this will do the job.
2929 </para>
2930 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002931
Eric Andersen21580922000-07-07 19:07:47 +00002932 <sect1 id="sleep">
2933 <title>sleep</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002934
Eric Andersen21580922000-07-07 19:07:47 +00002935 <para>
2936 Usage: sleep N
2937 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002938
Eric Andersen21580922000-07-07 19:07:47 +00002939 <para>
2940 Pause for N seconds.
2941 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002942
Eric Andersen21580922000-07-07 19:07:47 +00002943 <para>
2944 Example:
2945 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002946
Eric Andersen21580922000-07-07 19:07:47 +00002947 <para>
2948 <screen>
2949 $ sleep 2
2950 [2 second delay results]
2951 </screen>
2952 </para>
2953 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002954
Eric Andersen21580922000-07-07 19:07:47 +00002955 <sect1 id="sort">
2956 <title>sort</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002957
Eric Andersen21580922000-07-07 19:07:47 +00002958 <para>
2959 Usage: sort [OPTION]... [FILE]...
2960 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002961
Eric Andersen21580922000-07-07 19:07:47 +00002962 <para>
2963 Sort lines of text in FILE(s).
2964 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002965
Eric Andersen21580922000-07-07 19:07:47 +00002966 <para>
2967 Options:
2968 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002969
Eric Andersen21580922000-07-07 19:07:47 +00002970 <para>
2971 <screen>
2972 -n Compare numerically
2973 -r Reverse after sorting
2974 </screen>
2975 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002976
Eric Andersen21580922000-07-07 19:07:47 +00002977 <para>
2978 Example:
2979 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00002980
Eric Andersen21580922000-07-07 19:07:47 +00002981 <para>
2982 <screen>
2983 $ echo -e "e\nf\nb\nd\nc\na" | sort
2984 a
2985 b
2986 c
2987 d
2988 e
2989 f
2990 </screen>
2991 </para>
2992 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00002993
Eric Andersen21580922000-07-07 19:07:47 +00002994 <sect1 id="swapoff">
2995 <title>swapoff</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00002996
Eric Andersen21580922000-07-07 19:07:47 +00002997 <para>
2998 Usage: swapoff [OPTION] [DEVICE]
2999 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003000
Eric Andersen21580922000-07-07 19:07:47 +00003001 <para>
3002 Stop swapping virtual memory pages on DEVICE.
3003 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003004
Eric Andersen21580922000-07-07 19:07:47 +00003005 <para>
3006 Options:
3007 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003008
Eric Andersen21580922000-07-07 19:07:47 +00003009 <para>
3010 <screen>
3011 -a Stop swapping on all swap devices
3012 </screen>
3013 </para>
3014 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003015
Eric Andersen21580922000-07-07 19:07:47 +00003016 <sect1 id="swapon">
3017 <title>swapon</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003018
Eric Andersen21580922000-07-07 19:07:47 +00003019 <para>
3020 Usage: swapon [OPTION] [DEVICE]
3021 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003022
Eric Andersen21580922000-07-07 19:07:47 +00003023 <para>
3024 Start swapping virtual memory pages on the given device.
3025 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003026
Eric Andersen21580922000-07-07 19:07:47 +00003027 <para>
3028 Options:
3029 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003030
Eric Andersen21580922000-07-07 19:07:47 +00003031 <para>
3032 <screen>
3033 -a Start swapping on all swap devices
3034 </screen>
3035 </para>
3036 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003037
Eric Andersen21580922000-07-07 19:07:47 +00003038 <sect1 id="sync">
3039 <title>sync</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003040
Eric Andersen21580922000-07-07 19:07:47 +00003041 <para>
3042 Usage: sync
3043 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003044
Eric Andersen21580922000-07-07 19:07:47 +00003045 <para>
3046 Write all buffered filesystem blocks to disk.
3047 </para>
3048 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003049
Eric Andersen21580922000-07-07 19:07:47 +00003050 <sect1 id="syslogd">
3051 <title>syslogd</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003052
Eric Andersen21580922000-07-07 19:07:47 +00003053 <para>
3054 Usage: syslogd [OPTION]...
3055 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003056
Eric Andersen21580922000-07-07 19:07:47 +00003057 <para>
3058 Linux system and kernel (provides klogd) logging
3059 utility. Note that this version of syslogd/klogd ignores
3060 /etc/syslog.conf.
3061 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003062
Eric Andersen21580922000-07-07 19:07:47 +00003063 <para>
3064 Options:
3065 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003066
Eric Andersen21580922000-07-07 19:07:47 +00003067 <para>
3068 <screen>
3069 -m NUM Interval between MARK lines (default=20min, 0=off)
3070 -n Run as a foreground process
3071 -K Do not start up the klogd process
3072 -O FILE Use an alternate log file (default=/var/log/messages)
Eric Andersen70d09ed2000-12-11 16:24:16 +00003073 -R HOST[:PORT] Log remotely to IP or hostname on PORT (default PORT=514/UDP)
Eric Andersen20c2bdd2000-12-11 19:39:25 +00003074 -L Log locally as well as network logging (default is network only)
Eric Andersen21580922000-07-07 19:07:47 +00003075 </screen>
3076 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003077
Eric Andersen21580922000-07-07 19:07:47 +00003078 <para>
3079 Example:
3080 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003081
Eric Andersen21580922000-07-07 19:07:47 +00003082 <para>
3083 <screen>
Eric Andersenced2cef2000-07-20 23:41:24 +00003084 $ syslogd -R masterlog:514
3085 $ syslogd -R 192.168.1.1:601
Eric Andersen21580922000-07-07 19:07:47 +00003086 </screen>
3087 </para>
3088 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003089
Eric Andersen21580922000-07-07 19:07:47 +00003090 <sect1 id="tail">
3091 <title>tail</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003092
Eric Andersen21580922000-07-07 19:07:47 +00003093 <para>
3094 Usage: tail [OPTION] [FILE]...
3095 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003096
Eric Andersen21580922000-07-07 19:07:47 +00003097 <para>
3098 Print last 10 lines of each FILE to standard output.
3099 With more than one FILE, precede each with a header
3100 giving the file name. With no FILE, or when FILE is -,
3101 read stdin.
3102 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003103
Eric Andersen21580922000-07-07 19:07:47 +00003104 <para>
3105 Options:
3106 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003107
Eric Andersen21580922000-07-07 19:07:47 +00003108 <para>
3109 <screen>
3110 -n NUM Print last NUM lines instead of last 10
3111 -f Output data as the file grows. This version
3112 of 'tail -f' supports only one file at a time.
3113 </screen>
3114 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003115
Eric Andersen21580922000-07-07 19:07:47 +00003116 <para>
3117 Example:
3118 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003119
Eric Andersen21580922000-07-07 19:07:47 +00003120 <para>
3121 <screen>
3122 $ tail -n 1 /etc/resolv.conf
3123 nameserver 10.0.0.1
3124 </screen>
3125 </para>
3126 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003127
Eric Andersen21580922000-07-07 19:07:47 +00003128 <sect1 id="tar">
3129 <title>tar</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003130
Eric Andersen21580922000-07-07 19:07:47 +00003131 <para>
3132 Usage: tar [MODE] [OPTION] [FILE]...
3133 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003134
Eric Andersen21580922000-07-07 19:07:47 +00003135 <para>
3136
3137 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003138
Eric Andersen21580922000-07-07 19:07:47 +00003139 <para>
3140 MODE may be chosen from
3141 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003142
Eric Andersen21580922000-07-07 19:07:47 +00003143 <para>
3144 <screen>
3145 c Create
3146 x Extract
3147 t List
3148 </screen>
3149 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003150
Eric Andersen21580922000-07-07 19:07:47 +00003151 <para>
3152 Options:
3153 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003154
Eric Andersen21580922000-07-07 19:07:47 +00003155 <para>
3156 <screen>
Eric Andersenfdd51032000-08-02 18:48:26 +00003157 f FILE Use FILE for tarfile (or stdin if '-')
3158 O Extract to stdout
3159 exclude FILE File to exclude
3160 v List files processed
Eric Andersen21580922000-07-07 19:07:47 +00003161 </screen>
3162 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003163
Eric Andersen21580922000-07-07 19:07:47 +00003164 <para>
3165 Example:
3166 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003167
Eric Andersen21580922000-07-07 19:07:47 +00003168 <para>
3169 <screen>
3170 $ zcat /tmp/tarball.tar.gz | tar -xf -
3171 $ tar -cf /tmp/tarball.tar /usr/local
3172 </screen>
3173 </para>
3174 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003175
Eric Andersen21580922000-07-07 19:07:47 +00003176 <sect1 id="tee">
3177 <title>tee</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003178
Eric Andersen21580922000-07-07 19:07:47 +00003179 <para>
3180 Usage: tee [OPTION]... [FILE]...
3181 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003182
Eric Andersen21580922000-07-07 19:07:47 +00003183 <para>
3184 Copy stdin to FILE(s), and also to stdout.
3185 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003186
Eric Andersen21580922000-07-07 19:07:47 +00003187 <para>
3188 Options:
3189 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003190
Eric Andersen21580922000-07-07 19:07:47 +00003191 <para>
3192 <screen>
3193 -a Append to the given FILEs, do not overwrite
3194 </screen>
3195 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003196
Eric Andersen21580922000-07-07 19:07:47 +00003197 <para>
3198 Example:
3199 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003200
Eric Andersen21580922000-07-07 19:07:47 +00003201 <para>
3202 <screen>
3203 $ echo "Hello" | tee /tmp/foo
3204 Hello
3205 $ cat /tmp/foo
3206 Hello
3207 </screen>
3208 </para>
3209 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003210
Eric Andersen21580922000-07-07 19:07:47 +00003211 <sect1 id="telnet">
3212 <title>telnet</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003213
Eric Andersen21580922000-07-07 19:07:47 +00003214 <para>
3215 Usage: telnet HOST [PORT]
3216 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003217
Eric Andersen21580922000-07-07 19:07:47 +00003218 <para>
3219 Establish interactive communication with another
3220 computer over a network using the TELNET protocol.
3221 </para>
3222 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003223
Eric Andersen21580922000-07-07 19:07:47 +00003224 <sect1 id="test">
3225 <title>test, [</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003226
Eric Andersen21580922000-07-07 19:07:47 +00003227 <para>
3228 Usage: test EXPRESSION
3229 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003230
Eric Andersen21580922000-07-07 19:07:47 +00003231 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003232 or: [ EXPRESSION ]
Pavel Roskind2d3aa32000-09-15 17:16:40 +00003233 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003234
Eric Andersen21580922000-07-07 19:07:47 +00003235 <para>
3236 Check file types and compare values returning an exit
3237 code determined by the value of EXPRESSION.
3238 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003239
Eric Andersen21580922000-07-07 19:07:47 +00003240 <para>
3241 Example:
3242 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003243
Eric Andersen21580922000-07-07 19:07:47 +00003244 <para>
3245 <screen>
3246 $ test 1 -eq 2
3247 $ echo $?
3248 1
3249 $ test 1 -eq 1
3250 $ echo $?
3251 0
3252 $ [ -d /etc ]
3253 $ echo $?
3254 0
3255 $ [ -d /junk ]
3256 $ echo $?
3257 1
3258 </screen>
3259 </para>
3260 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003261
Eric Andersen21580922000-07-07 19:07:47 +00003262 <sect1 id="touch">
3263 <title>touch</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003264
Eric Andersen21580922000-07-07 19:07:47 +00003265 <para>
3266 Usage: touch [OPTION]... FILE...
3267 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003268
Eric Andersen21580922000-07-07 19:07:47 +00003269 <para>
3270 Update the last-modified date on (or create) FILE(s).
3271 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003272
Eric Andersen21580922000-07-07 19:07:47 +00003273 <para>
3274 Options:
3275 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003276
Eric Andersen21580922000-07-07 19:07:47 +00003277 <para>
3278 <screen>
3279 -c Do not create files
3280 </screen>
3281 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003282
Eric Andersen21580922000-07-07 19:07:47 +00003283 <para>
3284 Example:
3285 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003286
Eric Andersen21580922000-07-07 19:07:47 +00003287 <para>
3288 <screen>
3289 $ ls -l /tmp/foo
3290 /bin/ls: /tmp/foo: No such file or directory
3291 $ touch /tmp/foo
3292 $ ls -l /tmp/foo
3293 -rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo
3294 </screen>
3295 </para>
3296 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003297
Eric Andersen21580922000-07-07 19:07:47 +00003298 <sect1 id="tr">
3299 <title>tr</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003300
Eric Andersen21580922000-07-07 19:07:47 +00003301 <para>
3302 Usage: tr [OPTION]... STRING1 [STRING2]
3303 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003304
Eric Andersen21580922000-07-07 19:07:47 +00003305 <para>
3306 Translate, squeeze, and/or delete characters from stdin,
3307 writing to stdout.
3308 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003309
Eric Andersen21580922000-07-07 19:07:47 +00003310 <para>
3311 Options:
3312 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003313
Eric Andersen21580922000-07-07 19:07:47 +00003314 <para>
3315 <screen>
3316 -c Take complement of STRING1
3317 -d Delete input characters coded STRING1
3318 -s Squeeze multiple output characters of STRING2 into one character
3319 </screen>
3320 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003321
Eric Andersen21580922000-07-07 19:07:47 +00003322 <para>
3323 Example:
3324 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003325
Eric Andersen21580922000-07-07 19:07:47 +00003326 <para>
3327 <screen>
3328 $ echo "gdkkn vnqkc" | tr [a-y] [b-z]
3329 hello world
3330 </screen>
3331 </para>
3332 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003333
Eric Andersen21580922000-07-07 19:07:47 +00003334 <sect1 id="true">
3335 <title>true</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003336
Eric Andersen21580922000-07-07 19:07:47 +00003337 <para>
3338 Usage: true
3339 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003340
Eric Andersen21580922000-07-07 19:07:47 +00003341 <para>
3342 Return an exit code of TRUE (1).
3343 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003344
Eric Andersen21580922000-07-07 19:07:47 +00003345 <para>
3346 Example:
3347 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003348
Eric Andersen21580922000-07-07 19:07:47 +00003349 <para>
3350 <screen>
3351 $ true
3352 $ echo $?
3353 0
3354 </screen>
3355 </para>
3356 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003357
Eric Andersen21580922000-07-07 19:07:47 +00003358 <sect1 id="tty">
3359 <title>tty</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003360
Eric Andersen21580922000-07-07 19:07:47 +00003361 <para>
3362 Usage: tty
3363 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003364
Eric Andersen21580922000-07-07 19:07:47 +00003365 <para>
3366 Print the file name of the terminal connected to stdin.
3367 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003368
Eric Andersen21580922000-07-07 19:07:47 +00003369 <para>
3370 Options:
3371 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003372
Eric Andersen21580922000-07-07 19:07:47 +00003373 <para>
3374 <screen>
3375 -s Print nothing, only return an exit status
3376 </screen>
3377 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003378
Eric Andersen21580922000-07-07 19:07:47 +00003379 <para>
3380 Example:
3381 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003382
Eric Andersen21580922000-07-07 19:07:47 +00003383 <para>
3384 <screen>
3385 $ tty
3386 /dev/tty2
3387 </screen>
3388 </para>
3389 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003390
Eric Andersen21580922000-07-07 19:07:47 +00003391 <sect1 id="umount">
3392 <title>umount</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003393
Eric Andersen21580922000-07-07 19:07:47 +00003394 <para>
3395 Usage: umount [OPTION]... DEVICE|DIRECTORY
3396 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003397
Eric Andersen21580922000-07-07 19:07:47 +00003398 <para>
3399
3400 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003401
Eric Andersen21580922000-07-07 19:07:47 +00003402 <para>
3403 Options:
3404 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003405
Eric Andersen21580922000-07-07 19:07:47 +00003406 <para>
3407 <screen>
3408 -a Unmount all file systems
3409 -r Try to remount devices as read-only if mount is busy
Eric Andersen77d92682001-05-23 20:32:09 +00003410 -f Force filesystem umount (i.e., unreachable NFS server)
Eric Andersen21580922000-07-07 19:07:47 +00003411 -l Do not free loop device (if a loop device has been used)
3412 </screen>
3413 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003414
Eric Andersen21580922000-07-07 19:07:47 +00003415 <para>
3416 Example:
3417 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003418
Eric Andersen21580922000-07-07 19:07:47 +00003419 <para>
3420 <screen>
3421 $ umount /dev/hdc1
3422 </screen>
3423 </para>
3424 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003425
Eric Andersen21580922000-07-07 19:07:47 +00003426 <sect1 id="uname">
3427 <title>uname</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003428
Eric Andersen21580922000-07-07 19:07:47 +00003429 <para>
3430 Usage: uname [OPTION]...
3431 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003432
Eric Andersen21580922000-07-07 19:07:47 +00003433 <para>
3434 Print certain system information. With no OPTION, same
3435 as -s.
3436 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003437
Eric Andersen21580922000-07-07 19:07:47 +00003438 <para>
3439 Options:
3440 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003441
Eric Andersen21580922000-07-07 19:07:47 +00003442 <para>
3443 <screen>
3444 -a Print all information
3445 -m Print the machine (hardware) type
3446 -n Print the machine's network node hostname
3447 -r Print the operating system release
3448 -s Print the operating system name
3449 -p Print the host processor type
3450 -v Print the operating system version
3451 </screen>
3452 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003453
Eric Andersen21580922000-07-07 19:07:47 +00003454 <para>
3455 Example:
3456 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003457
Eric Andersen21580922000-07-07 19:07:47 +00003458 <para>
3459 <screen>
3460 $ uname -a
3461 Linux debian 2.2.15pre13 #5 Tue Mar 14 16:03:50 MST 2000 i686 unknown
3462 </screen>
3463 </para>
3464 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003465
Eric Andersen21580922000-07-07 19:07:47 +00003466 <sect1 id="uniq">
3467 <title>uniq</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003468
Eric Andersen21580922000-07-07 19:07:47 +00003469 <para>
3470 Usage: uniq [INPUT [OUTPUT]]
3471 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003472
Eric Andersen21580922000-07-07 19:07:47 +00003473 <para>
3474 Discard all but one of successive identical lines from
3475 INPUT (or stdin), writing to OUTPUT (or stdout).
3476 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003477
Eric Andersen21580922000-07-07 19:07:47 +00003478 <para>
Eric Andersen5b5db382000-12-09 16:37:53 +00003479 Options:
3480 </para>
3481
3482 <para>
3483 <screen>
3484 -c prefix lines by the number of occurrences
3485 -d only print duplicate lines
3486 -u only print unique lines
3487 </screen>
3488 </para>
3489
3490 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003491 Example:
3492 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003493
Eric Andersen21580922000-07-07 19:07:47 +00003494 <para>
3495 <screen>
3496 $ echo -e "a\na\nb\nc\nc\na" | sort | uniq
3497 a
3498 b
3499 c
3500 </screen>
3501 </para>
3502 </sect1>
Eric Andersencff3fe32000-09-20 19:22:26 +00003503
3504 <sect1 id="unix2dos">
3505 <title>unix2dos</title>
3506
3507 <para>
3508 Usage: unix2dos < unixfile > dosfile
3509 </para>
3510
3511 <para>
3512 Converts a text file from unix format to dos format.
3513 </para>
3514
3515 </sect1>
3516
3517 <sect1 id="unrpm">
Eric Andersen57f83ff2000-09-24 02:41:44 +00003518 <title>unrpm</title>
Eric Andersencff3fe32000-09-20 19:22:26 +00003519
3520 <para>
3521 Usage: unrpm < package.rpm | gzip -d | cpio -idmuv
3522 </para>
3523
3524 <para>
3525 Extracts an rpm archive.
3526 </para>
3527
3528 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003529
Eric Andersen21580922000-07-07 19:07:47 +00003530 <sect1 id="update">
3531 <title>update</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003532
Eric Andersen21580922000-07-07 19:07:47 +00003533 <para>
3534 Usage: update [OPTION]...
3535 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003536
Eric Andersen21580922000-07-07 19:07:47 +00003537 <para>
3538 Periodically flush filesystem buffers.
3539 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003540
Eric Andersen21580922000-07-07 19:07:47 +00003541 <para>
3542 Options:
3543 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003544
Eric Andersen21580922000-07-07 19:07:47 +00003545 <para>
3546 <screen>
3547 -S Force use of sync(2) instead of flushing
3548 -s SECS Call sync this often (default 30)
3549 -f SECS Flush some buffers this often (default 5)
3550 </screen>
3551 </para>
3552 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003553
Eric Andersen21580922000-07-07 19:07:47 +00003554 <sect1 id="uptime">
3555 <title>uptime</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003556
Eric Andersen21580922000-07-07 19:07:47 +00003557 <para>
3558 Usage: uptime
3559 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003560
Eric Andersen21580922000-07-07 19:07:47 +00003561 <para>
3562 Display how long the system has been running since boot.
3563 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003564
Eric Andersen21580922000-07-07 19:07:47 +00003565 <para>
3566 Example:
3567 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003568
Eric Andersen21580922000-07-07 19:07:47 +00003569 <para>
3570 <screen>
3571 $ uptime
3572 1:55pm up 2:30, load average: 0.09, 0.04, 0.00
3573 </screen>
3574 </para>
3575 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003576
Eric Andersen21580922000-07-07 19:07:47 +00003577 <sect1 id="usleep">
3578 <title>usleep</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003579
Eric Andersen21580922000-07-07 19:07:47 +00003580 <para>
3581 Usage: usleep N
3582 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003583
Eric Andersen21580922000-07-07 19:07:47 +00003584 <para>
3585 Pause for N microseconds.
3586 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003587
Eric Andersen21580922000-07-07 19:07:47 +00003588 <para>
3589 Example:
3590 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003591
Eric Andersen21580922000-07-07 19:07:47 +00003592 <para>
3593 <screen>
3594 $ usleep 1000000
3595 [pauses for 1 second]
3596 </screen>
3597 </para>
3598 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003599
Eric Andersen21580922000-07-07 19:07:47 +00003600 <sect1 id="uudecode">
3601 <title>uudecode</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003602
Eric Andersen21580922000-07-07 19:07:47 +00003603 <para>
3604 Usage: uudecode [OPTION] [FILE]
3605 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003606
Eric Andersen21580922000-07-07 19:07:47 +00003607 <para>
3608 Uudecode a uuencoded file.
3609 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003610
Eric Andersen21580922000-07-07 19:07:47 +00003611 <para>
3612 Options:
3613 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003614
Eric Andersen21580922000-07-07 19:07:47 +00003615 <para>
3616 <screen>
3617 -o FILE Direct output to FILE
3618 </screen>
3619 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003620
Eric Andersen21580922000-07-07 19:07:47 +00003621 <para>
3622 Example:
3623 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003624
Eric Andersen21580922000-07-07 19:07:47 +00003625 <para>
3626 <screen>
3627 $ uudecode -o busybox busybox.uu
3628 $ ls -l busybox
3629 -rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox
3630 </screen>
3631 </para>
3632 </sect1>
Eric Andersen028fb622000-07-04 20:07:13 +00003633
Eric Andersen21580922000-07-07 19:07:47 +00003634 <sect1 id="uuencode">
3635 <title>uuencode</title>
Eric Andersen028fb622000-07-04 20:07:13 +00003636
Eric Andersen21580922000-07-07 19:07:47 +00003637 <para>
3638 Usage: uuencode [OPTION] [INFILE] OUTFILE
3639 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003640
Eric Andersen21580922000-07-07 19:07:47 +00003641 <para>
3642 Uuencode a file.
3643 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003644
Eric Andersen21580922000-07-07 19:07:47 +00003645 <para>
3646 Options:
3647 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003648
Eric Andersen21580922000-07-07 19:07:47 +00003649 <para>
3650 <screen>
3651 -m Use base64 encoding as of RFC1521
3652 </screen>
3653 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003654
Eric Andersen21580922000-07-07 19:07:47 +00003655 <para>
3656 Example:
3657 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003658
Eric Andersen21580922000-07-07 19:07:47 +00003659 <para>
3660 <screen>
3661 $ uuencode busybox busybox
3662 begin 755 busybox
3663 M?T5,1@$!`0````````````(``P`!````L+@$"#0```!0N@,``````#0`(``&amp;
3664 .....
3665 $ uudecode busybox busybox &gt; busybox.uu
3666 $
3667 </screen>
3668 </para>
3669 </sect1>
Eric Andersen028fb622000-07-04 20:07:13 +00003670
Eric Andersenffde8672001-01-25 23:40:32 +00003671 <sect1 id="watchdog">
3672 <title>watchdog</title>
3673
3674 <para>
3675 Usage: watchdog device
3676 </para>
3677
3678 <para>
3679 Periodically writes to watchdog device B<device>.
3680 </para>
3681 </sect1>
3682
Eric Andersen21580922000-07-07 19:07:47 +00003683 <sect1 id="wc">
3684 <title>wc</title>
Eric Andersen028fb622000-07-04 20:07:13 +00003685
Eric Andersen21580922000-07-07 19:07:47 +00003686 <para>
3687 Usage: wc [OPTION]... [FILE]...
3688 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003689
Eric Andersen21580922000-07-07 19:07:47 +00003690 <para>
3691 Print line, word, and byte counts for each FILE, and a
3692 total line if more than one FILE is specified. With no
3693 FILE, read stdin.
3694 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003695
Eric Andersen21580922000-07-07 19:07:47 +00003696 <para>
3697 Options:
3698 </para>
Eric Andersen028fb622000-07-04 20:07:13 +00003699
Eric Andersen21580922000-07-07 19:07:47 +00003700 <para>
3701 <screen>
3702 -c Print the byte counts
3703 -l Print the newline counts
3704 -L Print the length of the longest line
3705 -w Print the word counts
3706 </screen>
3707 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003708
Eric Andersen21580922000-07-07 19:07:47 +00003709 <para>
3710 Example:
3711 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003712
Eric Andersen21580922000-07-07 19:07:47 +00003713 <para>
3714 <screen>
3715 $ wc /etc/passwd
3716 31 46 1365 /etc/passwd
3717 </screen>
3718 </para>
3719 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003720
Eric Andersen21580922000-07-07 19:07:47 +00003721 <sect1 id="which">
3722 <title>which</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003723
Eric Andersen21580922000-07-07 19:07:47 +00003724 <para>
3725 Usage: which [COMMAND]...
3726 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003727
Eric Andersen21580922000-07-07 19:07:47 +00003728 <para>
3729 Locate COMMAND(s).
3730 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003731
Eric Andersen21580922000-07-07 19:07:47 +00003732 <para>
3733 Example:
3734 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003735
Eric Andersen21580922000-07-07 19:07:47 +00003736 <para>
3737 <screen>
3738 $ which login
3739 /bin/login
3740 </screen>
3741 </para>
3742 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003743
Eric Andersen21580922000-07-07 19:07:47 +00003744 <sect1 id="whoami">
3745 <title>whoami</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003746
Eric Andersen21580922000-07-07 19:07:47 +00003747 <para>
3748 Usage: whoami
3749 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003750
Eric Andersen21580922000-07-07 19:07:47 +00003751 <para>
3752 Print the user name associated with the current
3753 effective user id.
3754 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003755
Eric Andersen21580922000-07-07 19:07:47 +00003756 <para>
3757 Example:
3758 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003759
Eric Andersen21580922000-07-07 19:07:47 +00003760 <para>
3761 <screen>
3762 $ whoami
3763 andersen
3764 </screen>
3765 </para>
3766 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003767
Eric Andersen5b176932000-09-22 20:22:28 +00003768 <sect1 id="xargs">
3769 <title>xargs</title>
3770
3771 <para>
3772 Usage: xargs [OPTIONS] [COMMAND] [ARGS...]
3773 </para>
3774
3775 <para>
3776 Executes COMMAND on every item given by standard input.
3777 </para>
3778
3779 <para>
3780 Options:
3781 </para>
3782
3783 <para>
3784 <screen>
3785 -t Print the command just before it is run
Eric Andersen5b176932000-09-22 20:22:28 +00003786 </screen>
3787 </para>
3788
3789
3790 <para>
3791 Example:
3792 </para>
3793
3794 <para>
3795 <screen>
3796 $ ls | xargs gzip
3797 $ find . -name '*.c' -print | xargs rm
3798 </screen>
3799 </para>
3800 </sect1>
3801
Eric Andersen21580922000-07-07 19:07:47 +00003802 <sect1 id="yes">
3803 <title>yes</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003804
Eric Andersen21580922000-07-07 19:07:47 +00003805 <para>
3806 Usage: yes [STRING]...
3807 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003808
Eric Andersen21580922000-07-07 19:07:47 +00003809 <para>
3810 Repeatedly output a line with all specified STRING(s),
3811 or `y'.
3812 </para>
3813 </sect1>
Mark Whitley83a949c2000-06-26 13:31:53 +00003814
Eric Andersen21580922000-07-07 19:07:47 +00003815 <sect1 id="zcat">
3816 <title>zcat</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003817
Eric Andersen21580922000-07-07 19:07:47 +00003818 <para>
3819 Usage: zcat [OPTION]... FILE
3820 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003821
Eric Andersen21580922000-07-07 19:07:47 +00003822 <para>
3823 Uncompress FILE (or stdin if FILE is '-') to stdout.
3824 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003825
Eric Andersen21580922000-07-07 19:07:47 +00003826 <para>
3827 Options:
3828 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003829
Eric Andersen21580922000-07-07 19:07:47 +00003830 <para>
3831 <screen>
3832 -t Test compressed file integrity
3833 </screen>
3834 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003835
Eric Andersen21580922000-07-07 19:07:47 +00003836 <para>
3837 Example:
3838 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003839
Eric Andersen21580922000-07-07 19:07:47 +00003840 <para>
3841 <screen>
3842 </screen>
3843 </para>
3844 </sect1>
3845 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +00003846
Eric Andersen21580922000-07-07 19:07:47 +00003847 <chapter id="LIBC-NSS">
3848 <title>LIBC NSS</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003849
Eric Andersen21580922000-07-07 19:07:47 +00003850 <para>
3851 GNU Libc uses the Name Service Switch (NSS) to configure the
3852 behavior of the C library for the local environment, and to
3853 configure how it reads system data, such as passwords and group
3854 information. BusyBox has made it Policy that it will never use
3855 NSS, and will never use libc calls that make use of NSS. This
3856 allows you to run an embedded system without the need for
3857 installing an /etc/nsswitch.conf file and without /lib/libnss_*
3858 libraries installed.
3859 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003860
Eric Andersen21580922000-07-07 19:07:47 +00003861 <para>
3862 If you are using a system that is using a remote LDAP server for
3863 authentication via GNU libc NSS, and you want to use BusyBox,
3864 then you will need to adjust the BusyBox source. Chances are
3865 though, that if you have enough space to install of that stuff
3866 on your system, then you probably want the full GNU utilities.
3867 </para>
3868 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +00003869
Eric Andersen21580922000-07-07 19:07:47 +00003870 <chapter id="SEE-ALSO">
3871 <title>SEE ALSO</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003872
Eric Andersen21580922000-07-07 19:07:47 +00003873 <para>
3874 <literal>textutils(1),</literal>
3875 <literal>shellutils(1),</literal>
3876 etc...
3877 </para>
3878 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +00003879
Eric Andersen21580922000-07-07 19:07:47 +00003880 <chapter id="MAINTAINER">
3881 <title>MAINTAINER</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003882
Eric Andersen21580922000-07-07 19:07:47 +00003883 <para>
3884 Erik Andersen &lt;andersee@debian.org&gt; &lt;andersen@lineo.com&gt;
3885 </para>
3886 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +00003887
Eric Andersen21580922000-07-07 19:07:47 +00003888 <chapter id="AUTHORS">
3889 <title>AUTHORS</title>
Mark Whitley83a949c2000-06-26 13:31:53 +00003890
Eric Andersen21580922000-07-07 19:07:47 +00003891 <para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003892 The following people have made significant contributions to
3893 BusyBox -- whether they know it or not.
Eric Andersen21580922000-07-07 19:07:47 +00003894 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003895
Eric Andersen21580922000-07-07 19:07:47 +00003896 <para>
3897 Erik Andersen &lt;andersee@debian.org&gt;
3898 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003899
Eric Andersen21580922000-07-07 19:07:47 +00003900 <para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003901 Edward Betts &lt;edward@debian.org&gt;
3902 </para>
3903
3904 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003905 John Beppu &lt;beppu@lineo.com&gt;
3906 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003907
Eric Andersen21580922000-07-07 19:07:47 +00003908 <para>
3909 Brian Candler &lt;B.Candler@pobox.com&gt;
3910 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003911
Eric Andersen21580922000-07-07 19:07:47 +00003912 <para>
3913 Randolph Chung &lt;tausq@debian.org&gt;
3914 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003915
Eric Andersen21580922000-07-07 19:07:47 +00003916 <para>
3917 Dave Cinege &lt;dcinege@psychosis.com&gt;
3918 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003919
Eric Andersen21580922000-07-07 19:07:47 +00003920 <para>
3921 Karl M. Hegbloom &lt;karlheg@debian.org&gt;
3922 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003923
Eric Andersen21580922000-07-07 19:07:47 +00003924 <para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003925 Daniel Jacobowitz &lt;dan@debian.org&gt;
3926 </para>
3927
3928 <para>
3929 Matt Kraai &lt;kraai@alumni.carnegiemellon.edu&gt;
3930 </para>
3931
3932 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003933 John Lombardo &lt;john@deltanet.com&gt;
3934 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003935
Eric Andersen21580922000-07-07 19:07:47 +00003936 <para>
3937 Glenn McGrath &lt;bug1@netconnect.com.au&gt;
3938 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003939
Eric Andersen21580922000-07-07 19:07:47 +00003940 <para>
3941 Bruce Perens &lt;bruce@perens.com&gt;
3942 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003943
Eric Andersen21580922000-07-07 19:07:47 +00003944 <para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003945 Chip Rosenthal &lt;chip@unicom.com&gt;, &lt;crosenth@covad.com&gt;
3946 </para>
3947
3948 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003949 Pavel Roskin &lt;proski@gnu.org&gt;
3950 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003951
Eric Andersen21580922000-07-07 19:07:47 +00003952 <para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003953 Gyepi Sam &lt;gyepi@praxis-sw.com&gt;
3954 </para>
3955
3956 <para>
Eric Andersen21580922000-07-07 19:07:47 +00003957 Linus Torvalds &lt;torvalds@transmeta.com&gt;
3958 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003959
John Beppu2aee9932000-09-15 08:04:42 +00003960 <para>
3961 Mark Whitley &lt;markw@lineo.com&gt;
3962 </para>
3963
Eric Andersen21580922000-07-07 19:07:47 +00003964 <para>
3965 Charles P. Wright &lt;cpwright@villagenet.com&gt;
3966 </para>
Mark Whitley83a949c2000-06-26 13:31:53 +00003967
Eric Andersen21580922000-07-07 19:07:47 +00003968 <para>
3969 Enrique Zanardi &lt;ezanardi@ull.es&gt;
3970 </para>
Eric Andersen57f83ff2000-09-24 02:41:44 +00003971
3972
Eric Andersen21580922000-07-07 19:07:47 +00003973 </chapter>
Mark Whitley83a949c2000-06-26 13:31:53 +00003974</book> <!-- End of the book -->