blob: 75763d33fab8be73d3b7f5e5fc1d21a3c0bfcd73 [file] [log] [blame]
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001# vi: set sw=4 ts=4:
John Beppu08e7f752000-04-13 03:22:20 +00002
John Beppu3a1b6be2000-01-18 15:45:59 +00003=head1 NAME
4
Erik Andersencf8d38a2000-04-21 01:23:36 +00005BusyBox - The Swiss Army Knife of Embedded Linux
John Beppu3a1b6be2000-01-18 15:45:59 +00006
Erik Andersencf8d38a2000-04-21 01:23:36 +00007=head1 SYNTAX
John Beppu3a1b6be2000-01-18 15:45:59 +00008
Erik Andersencf8d38a2000-04-21 01:23:36 +00009 BusyBox <function> [arguments...] # or
John Beppu46a4e762000-01-18 22:33:11 +000010
11 <function> [arguments...] # if symlinked
John Beppu3a1b6be2000-01-18 15:45:59 +000012
13=head1 DESCRIPTION
14
Erik Andersencf8d38a2000-04-21 01:23:36 +000015BusyBox combines tiny versions of many common UNIX utilities into a single
16small executable. It provides minimalist replacements for most of the utilities
17you usually find in fileutils, shellutils, findutils, textutils, grep, gzip,
18tar, etc. BusyBox provides a fairly complete POSIX environment for any small
Eric Andersen98cd53e2000-06-16 19:56:44 +000019or embedded system. The utilities in BusyBox generally have fewer options than
Eric Andersenf2fffef2000-06-05 17:23:06 +000020their full-featured GNU cousins; however, the options that are included provide
Erik Andersene90f4042000-04-21 21:53:58 +000021the expected functionality and behave very much like their GNU counterparts.
Erik Andersen62dc17a2000-04-13 01:18:23 +000022
Erik Andersencf8d38a2000-04-21 01:23:36 +000023BusyBox has been written with size-optimization and limited resources in mind.
24It is also extremely modular so you can easily include or exclude commands (or
25features) at compile time. This makes it easy to customize your embedded
26systems. To create a working system, just add a kernel, a shell (such as ash),
27and an editor (such as elvis-tiny or ae).
28
29=head1 USAGE
30
31When you create a link to BusyBox for the function you wish to use, when BusyBox
32is called using that link it will behave as if the command itself has been invoked.
33
34For example, entering
35
36 ln -s ./BusyBox ls
Erik Andersen62dc17a2000-04-13 01:18:23 +000037 ./ls
38
39will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiled
Erik Andersencf8d38a2000-04-21 01:23:36 +000040into BusyBox).
Erik Andersen62dc17a2000-04-13 01:18:23 +000041
Erik Andersencf8d38a2000-04-21 01:23:36 +000042You can also invoke BusyBox by issuing the command as an argument on the
43command line. For example, entering
44
45 ./BusyBox ls
Erik Andersen62dc17a2000-04-13 01:18:23 +000046
47will also cause BusyBox to behave as 'ls'.
John Beppu08fe43d2000-01-19 12:39:16 +000048
Erik Anderseneef65802000-04-19 05:12:02 +000049=head1 COMMON OPTIONS
50
51Most BusyBox commands support the B<--help> option to provide a
52terse runtime description of their behavior.
53
John Beppu46a4e762000-01-18 22:33:11 +000054=head1 COMMANDS
55
Erik Andersen62dc17a2000-04-13 01:18:23 +000056Currently defined functions include:
57
Eric Andersen86ab8a32000-06-02 03:21:42 +000058ar, basename, cat, chgrp, chmod, chown, chroot, clear, chvt, cp, cut, date, dd,
59df, dirname, dmesg, du, dutmp, echo, false, fbset, fdflush, find, free,
Erik Andersen5e1189e2000-04-15 16:34:54 +000060freeramdisk, deallocvt, fsck.minix, grep, gunzip, gzip, halt, head, hostid,
Erik Andersen73c8c9c2000-05-13 05:36:13 +000061hostname, id, init, kill, killall, length, ln, loadacm, loadfont, loadkmap,
Eric Andersen2b6ab3c2000-06-13 06:54:53 +000062logger, logname, ls, lsmod, makedevs, math, md5sum, mkdir, mkfifo, mkfs.minix,
63mknod, mkswap, mktemp, nc, more, mount, mt, mv, nslookup, ping, poweroff,
64printf, ps, pwd, reboot, rm, rmdir, rmmod, sed, setkeycodes, sh, sfdisk, sleep,
65sort, sync, syslogd, swapon, swapoff, tail, tar, test, tee, touch, tr, true,
66tty, umount, uname, uniq, update, uptime, usleep, uudecode, uuencode, wc,
67whoami, yes, zcat, [
Erik Andersen62dc17a2000-04-13 01:18:23 +000068
Erik Andersena19bc642000-05-02 06:40:02 +000069-------------------------------
70
John Beppu46a4e762000-01-18 22:33:11 +000071=over 4
72
Eric Andersen86ab8a32000-06-02 03:21:42 +000073=item ar
74
75Usage: ar [optxvV] archive [filenames]
76
77Extract or list files from an ar archive.
78
79Options:
80
81 o preserve original dates
82 p extract to stdout
83 t list
84 x extract
85 v verbosely list files processed
86
87-------------------------------
88
Erik Andersen62dc17a2000-04-13 01:18:23 +000089=item basename
90
Erik Andersenac130e12000-05-10 05:00:31 +000091Usage: basename FILE [SUFFIX]
Erik Andersen62dc17a2000-04-13 01:18:23 +000092
Erik Andersenac130e12000-05-10 05:00:31 +000093Strips directory path and suffixes from FILE.
94If specified, also removes any trailing SUFFIX.
Erik Andersen62dc17a2000-04-13 01:18:23 +000095
96Example:
97
98 $ basename /usr/local/bin/foo
99 foo
100 $ basename /usr/local/bin/
101 bin
Erik Andersenac130e12000-05-10 05:00:31 +0000102 $ basename /foo/bar.txt .txt
103 bar
Erik Andersen62dc17a2000-04-13 01:18:23 +0000104
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000105-------------------------------
106
Erik Andersena6c75222000-04-18 00:00:52 +0000107=item cat
John Beppu46a4e762000-01-18 22:33:11 +0000108
Erik Andersencf8d38a2000-04-21 01:23:36 +0000109Usage: cat [FILE ...]
Erik Andersen62dc17a2000-04-13 01:18:23 +0000110
Erik Andersencf8d38a2000-04-21 01:23:36 +0000111Concatenates FILE(s) and prints them to the standard output.
Erik Andersen62dc17a2000-04-13 01:18:23 +0000112
113Example:
114
115 $ cat /proc/uptime
116 110716.72 17.67
John Beppu4581b4c2000-01-19 15:04:41 +0000117
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000118-------------------------------
119
Erik Andersen5e1189e2000-04-15 16:34:54 +0000120=item chgrp
121
122Usage: chgrp [OPTION]... GROUP FILE...
123
124Change the group membership of each FILE to GROUP.
Erik Andersen26702fe2000-04-17 16:44:46 +0000125
Erik Andersen5e1189e2000-04-15 16:34:54 +0000126Options:
127
128 -R change files and directories recursively
Erik Andersen26702fe2000-04-17 16:44:46 +0000129
Erik Andersen5e1189e2000-04-15 16:34:54 +0000130Example:
131
132 $ ls -l /tmp/foo
133 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
134 $ chgrp root /tmp/foo
135 $ ls -l /tmp/foo
136 -r--r--r-- 1 andersen root 0 Apr 12 18:25 /tmp/foo
137
138-------------------------------
139
John Beppu46a4e762000-01-18 22:33:11 +0000140=item chmod
141
John Beppuf17792c2000-04-13 03:16:01 +0000142Usage: chmod [B<-R>] MODE[,MODE]... FILE...
John Beppu4581b4c2000-01-19 15:04:41 +0000143
Erik Andersencf8d38a2000-04-21 01:23:36 +0000144Changes file access permissions for the specified FILE(s) (or directories).
Erik Andersen62dc17a2000-04-13 01:18:23 +0000145Each MODE is defined by combining the letters for WHO has access to the file,
146an OPERATOR for selecting how the permissions should be changed, and a
Eric Andersen98cd53e2000-06-16 19:56:44 +0000147PERMISSION for FILE(s) (or directories).
Erik Andersen62dc17a2000-04-13 01:18:23 +0000148
Erik Andersencf8d38a2000-04-21 01:23:36 +0000149WHO may be chosen from
Erik Andersen62dc17a2000-04-13 01:18:23 +0000150
Erik Andersencf8d38a2000-04-21 01:23:36 +0000151 u User who owns the file
152 g Users in the file's Group
Erik Andersen62dc17a2000-04-13 01:18:23 +0000153 o Other users not in the file's group
154 a All users
155
Erik Andersencf8d38a2000-04-21 01:23:36 +0000156OPERATOR may be chosen from
Erik Andersen62dc17a2000-04-13 01:18:23 +0000157
Erik Andersencf8d38a2000-04-21 01:23:36 +0000158 + Add a permission
159 - Remove a permission
160 = Assign a permission
Erik Andersen62dc17a2000-04-13 01:18:23 +0000161
Erik Andersencf8d38a2000-04-21 01:23:36 +0000162PERMISSION may be chosen from
Erik Andersen62dc17a2000-04-13 01:18:23 +0000163
Erik Andersencf8d38a2000-04-21 01:23:36 +0000164 r Read
Erik Andersen62dc17a2000-04-13 01:18:23 +0000165 w Write
Erik Andersencf8d38a2000-04-21 01:23:36 +0000166 x Execute (or access for directories)
Erik Andersen62dc17a2000-04-13 01:18:23 +0000167 s Set user (or group) ID bit
Eric Andersen98cd53e2000-06-16 19:56:44 +0000168 t Sticky bit (for directories prevents removing files by non-owners)
Erik Andersen62dc17a2000-04-13 01:18:23 +0000169
Erik Andersencf8d38a2000-04-21 01:23:36 +0000170Alternately, permissions can be set numerically where the first three
171numbers are calculated by adding the octal values, such as
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000172
Erik Andersen62dc17a2000-04-13 01:18:23 +0000173 4 Read
174 2 Write
Erik Andersencf8d38a2000-04-21 01:23:36 +0000175 1 Execute
Erik Andersen62dc17a2000-04-13 01:18:23 +0000176
Erik Andersencf8d38a2000-04-21 01:23:36 +0000177An optional fourth digit can also be used to specify
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000178
Erik Andersen62dc17a2000-04-13 01:18:23 +0000179 4 Set user ID
180 2 Set group ID
Eric Andersen98cd53e2000-06-16 19:56:44 +0000181 1 Sticky bit
Erik Andersen62dc17a2000-04-13 01:18:23 +0000182
John Beppu4581b4c2000-01-19 15:04:41 +0000183Options:
184
Erik Andersencf8d38a2000-04-21 01:23:36 +0000185 -R Change files and directories recursively.
John Beppu4581b4c2000-01-19 15:04:41 +0000186
Erik Andersen62dc17a2000-04-13 01:18:23 +0000187Example:
188
189 $ ls -l /tmp/foo
190 -rw-rw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo
191 $ chmod u+x /tmp/foo
192 $ ls -l /tmp/foo
193 -rwxrw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo*
194 $ chmod 444 /tmp/foo
195 $ ls -l /tmp/foo
196 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
John Beppu4581b4c2000-01-19 15:04:41 +0000197
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000198-------------------------------
199
John Beppu46a4e762000-01-18 22:33:11 +0000200=item chown
201
Erik Andersencf8d38a2000-04-21 01:23:36 +0000202Usage: chown [OPTION]... OWNER[<.|:>[GROUP] FILE...
John Beppu4581b4c2000-01-19 15:04:41 +0000203
Erik Andersen62dc17a2000-04-13 01:18:23 +0000204Changes the owner and/or group of each FILE to OWNER and/or GROUP.
John Beppu5a50def2000-04-17 17:46:46 +0000205
John Beppu4581b4c2000-01-19 15:04:41 +0000206Options:
207
Erik Andersencf8d38a2000-04-21 01:23:36 +0000208 -R Changes files and directories recursively
Erik Andersen62dc17a2000-04-13 01:18:23 +0000209
210Example:
211
212 $ ls -l /tmp/foo
213 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
214 $ chown root /tmp/foo
215 $ ls -l /tmp/foo
216 -r--r--r-- 1 root andersen 0 Apr 12 18:25 /tmp/foo
217 $ chown root.root /tmp/foo
218 ls -l /tmp/foo
219 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
John Beppu4581b4c2000-01-19 15:04:41 +0000220
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000221-------------------------------
222
John Beppu46a4e762000-01-18 22:33:11 +0000223=item chroot
224
John Beppu4581b4c2000-01-19 15:04:41 +0000225Usage: chroot NEWROOT [COMMAND...]
226
227Run COMMAND with root directory set to NEWROOT.
228
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000229Example:
Erik Andersen62dc17a2000-04-13 01:18:23 +0000230
231 $ ls -l /bin/ls
Erik Andersencf8d38a2000-04-21 01:23:36 +0000232 lrwxrwxrwx 1 root root 12 Apr 13 00:46 /bin/ls -> /BusyBox
Erik Andersen62dc17a2000-04-13 01:18:23 +0000233 $ mount /dev/hdc1 /mnt -t minix
234 $ chroot /mnt
235 $ ls -l /bin/ls
236 -rwxr-xr-x 1 root root 40816 Feb 5 07:45 /bin/ls*
John Beppu4581b4c2000-01-19 15:04:41 +0000237
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000238-------------------------------
239
John Beppu46a4e762000-01-18 22:33:11 +0000240=item clear
241
Erik Andersen62dc17a2000-04-13 01:18:23 +0000242Clears the screen.
John Beppu4581b4c2000-01-19 15:04:41 +0000243
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000244-------------------------------
245
John Beppu46a4e762000-01-18 22:33:11 +0000246=item chvt
247
John Beppu4581b4c2000-01-19 15:04:41 +0000248Usage: chvt N
249
Erik Andersencf8d38a2000-04-21 01:23:36 +0000250Changes the foreground virtual terminal to /dev/ttyN
John Beppu50ed0672000-04-13 23:44:04 +0000251
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000252-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +0000253
John Beppu46a4e762000-01-18 22:33:11 +0000254=item cp
255
John Beppu4581b4c2000-01-19 15:04:41 +0000256Usage: cp [OPTION]... SOURCE DEST
257
Erik Andersen62dc17a2000-04-13 01:18:23 +0000258 or: cp [OPTION]... SOURCE... DIRECTORY
John Beppu4581b4c2000-01-19 15:04:41 +0000259
Erik Andersencf8d38a2000-04-21 01:23:36 +0000260Copies SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
John Beppu4581b4c2000-01-19 15:04:41 +0000261
Erik Andersene31c0662000-05-02 05:32:07 +0000262Options:
263
Erik Andersencf8d38a2000-04-21 01:23:36 +0000264 -a Same as -dpR
265 -d Preserves links
Eric Andersen98cd53e2000-06-16 19:56:44 +0000266 -p Preserves file attributes if possible
Erik Andersencf8d38a2000-04-21 01:23:36 +0000267 -R Copies directories recursively
John Beppu4581b4c2000-01-19 15:04:41 +0000268
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000269-------------------------------
270
Erik Andersen73c8c9c2000-05-13 05:36:13 +0000271=item cut
272
273Usage: cut [OPTION]... [FILE]...
274
275Prints selected fields from each input FILE to standard output.
276
277Options:
278
279 -b LIST Output only bytes from LIST
280 -c LIST Output only characters from LIST
281 -d DELIM Use DELIM instead of tab as the field delimiter
282 -f N Print only these fields
283 -n Ignored
284
285Example:
286
287 $ echo "Hello world" | cut -f 1 -d ' '
288 Hello
289 $ echo "Hello world" | cut -f 2 -d ' '
290 world
291
292
293-------------------------------
294
John Beppu46a4e762000-01-18 22:33:11 +0000295=item date
296
Erik Andersen62dc17a2000-04-13 01:18:23 +0000297Usage: date [OPTION]... [+FORMAT]
John Beppu4581b4c2000-01-19 15:04:41 +0000298
Erik Andersen62dc17a2000-04-13 01:18:23 +0000299 or: date [OPTION] [MMDDhhmm[[CC]YY][.ss]]
300
Erik Andersencf8d38a2000-04-21 01:23:36 +0000301Displays the current time in the given FORMAT, or sets the system date.
Erik Andersen62dc17a2000-04-13 01:18:23 +0000302
303Options:
Erik Andersene31c0662000-05-02 05:32:07 +0000304
Erik Andersencf8d38a2000-04-21 01:23:36 +0000305 -R Outputs RFC-822 compliant date string
306 -s Sets time described by STRING
307 -u Prints or sets Coordinated Universal Time
Erik Andersen62dc17a2000-04-13 01:18:23 +0000308
309Example:
John Beppuf17792c2000-04-13 03:16:01 +0000310
Erik Andersen62dc17a2000-04-13 01:18:23 +0000311 $ date
312 Wed Apr 12 18:52:41 MDT 2000
John Beppu4581b4c2000-01-19 15:04:41 +0000313
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000314-------------------------------
315
John Beppu00216792000-06-21 19:06:16 +0000316=item dc
317
318Usage: dc expression ...
319
320This is a Tiny RPN calculator that understands the
321following operations: +, -, /, *, and, or, not, eor.
322If no arguments are given, dc will process input from STDIN.
323
324The behaviour of BusyBox/dc deviates (just a little ;-) from
325GNU/dc, but this will be remedied in the future.
326
327Example:
328
329 $ dc 2 2 +
330 4
331 $ dc 8 8 \* 2 2 + /
332 16
333 $ dc 0 1 and
334 0
335 $ dc 0 1 or
336 1
337 $ echo 72 9 div 8 mul | dc
338 64
339
340-------------------------------
341
John Beppu46a4e762000-01-18 22:33:11 +0000342=item dd
343
Erik Andersen62dc17a2000-04-13 01:18:23 +0000344Usage: dd [if=name] [of=name] [bs=n] [count=n] [skip=n] [seek=n]
John Beppu4581b4c2000-01-19 15:04:41 +0000345
346Copy a file, converting and formatting according to options
347
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000348 if=FILE read from FILE instead of stdin
349 of=FILE write to FILE instead of stdout
350 bs=n read and write n bytes at a time
351 count=n copy only n input blocks
352 skip=n skip n input blocks
353 seek=n skip n output blocks
Erik Andersen62dc17a2000-04-13 01:18:23 +0000354
355Numbers may be suffixed by w (x2), k (x1024), b (x512), or M (x1024^2)
John Beppu4581b4c2000-01-19 15:04:41 +0000356
Erik Andersen62dc17a2000-04-13 01:18:23 +0000357Example:
358
359 $ dd if=/dev/zero of=/dev/ram1 bs=1M count=4
360 4+0 records in
361 4+0 records out
362
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000363-------------------------------
364
John Beppu46a4e762000-01-18 22:33:11 +0000365=item df
366
Erik Andersen62dc17a2000-04-13 01:18:23 +0000367Usage: df [filesystem ...]
368
369Prints the filesystem space used and space available.
370
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000371Example:
Erik Andersen62dc17a2000-04-13 01:18:23 +0000372
373 $ df
374 Filesystem 1k-blocks Used Available Use% Mounted on
375 /dev/sda3 8690864 8553540 137324 98% /
376 /dev/sda1 64216 36364 27852 57% /boot
377 $ df /dev/sda3
378 Filesystem 1k-blocks Used Available Use% Mounted on
379 /dev/sda3 8690864 8553540 137324 98% /
John Beppu4581b4c2000-01-19 15:04:41 +0000380
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000381-------------------------------
382
383=item dirname
384
385Usage: dirname NAME
386
387Strip non-directory suffix from file name
388
389Example:
390
391 $ dirname /tmp/foo
392 /tmp
393 $ dirname /tmp/foo/
394 /tmp
395
396-------------------------------
397
John Beppu46a4e762000-01-18 22:33:11 +0000398=item dmesg
399
John Beppuf17792c2000-04-13 03:16:01 +0000400Usage: dmesg [B<-c>] [B<-n> level] [B<-s> bufsize]
John Beppu4581b4c2000-01-19 15:04:41 +0000401
Erik Andersen62dc17a2000-04-13 01:18:23 +0000402Print or controls the kernel ring buffer.
John Beppu4581b4c2000-01-19 15:04:41 +0000403
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000404-------------------------------
405
John Beppu46a4e762000-01-18 22:33:11 +0000406=item du
407
Erik Andersen62dc17a2000-04-13 01:18:23 +0000408Usage: du [OPTION]... [FILE]...
John Beppu4581b4c2000-01-19 15:04:41 +0000409
Erik Andersen62dc17a2000-04-13 01:18:23 +0000410Summarize disk space used for each FILE and/or directory.
411Disk space is printed in units of 1k (i.e. 1024 bytes).
412
413Options:
John Beppuf17792c2000-04-13 03:16:01 +0000414
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000415 -l count sizes many times if hard linked
416 -s display only a total for each argument
Erik Andersen62dc17a2000-04-13 01:18:23 +0000417
418Example:
419
Erik Andersencf8d38a2000-04-21 01:23:36 +0000420 $ ./BusyBox du
Erik Andersen62dc17a2000-04-13 01:18:23 +0000421 16 ./CVS
422 12 ./kernel-patches/CVS
423 80 ./kernel-patches
424 12 ./tests/CVS
425 36 ./tests
426 12 ./scripts/CVS
427 16 ./scripts
428 12 ./docs/CVS
429 104 ./docs
430 2417 .
431
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000432-------------------------------
433
434=item dutmp
435
436Usage: dutmp [FILE]
437
438Dump utmp file format (pipe delimited) from FILE
439or stdin to stdout.
440
441Example:
442
443 $ dutmp /var/run/utmp
444 8|7||si|||0|0|0|955637625|760097|0
445 2|0|~|~~|reboot||0|0|0|955637625|782235|0
446 1|20020|~|~~|runlevel||0|0|0|955637625|800089|0
447 8|125||l4|||0|0|0|955637629|998367|0
448 6|245|tty1|1|LOGIN||0|0|0|955637630|998974|0
449 6|246|tty2|2|LOGIN||0|0|0|955637630|999498|0
450 7|336|pts/0|vt00andersen|andersen|:0.0|0|0|0|955637763|0|0
451
452-------------------------------
453
454=item echo
455
456Usage: echo [-neE] [ARG ...]
457
458Prints the specified ARGs to stdout
459
460Options:
461
462 -n suppress trailing newline
463 -e interpret backslash-escaped characters (i.e. \t=tab etc)
464 -E disable interpretation of backslash-escaped characters
465
466Example:
467
468 $ echo "Erik is cool"
469 Erik is cool
470 $ echo -e "Erik\nis\ncool"
471 Erik
472 is
473 cool
474 $ echo "Erik\nis\ncool"
475 Erik\nis\ncool
476
477-------------------------------
478
479=item false
480
Erik Andersen5e1189e2000-04-15 16:34:54 +0000481Returns an exit code of FALSE (1)
482
483Example:
484
485 $ false
486 $ echo $?
487 1
488
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000489-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +0000490
John Beppu46a4e762000-01-18 22:33:11 +0000491=item fbset
492
John Beppu4581b4c2000-01-19 15:04:41 +0000493Usage: fbset [options] [mode]
494
Erik Andersen62dc17a2000-04-13 01:18:23 +0000495Show and modify frame buffer device settings
496
John Beppu4581b4c2000-01-19 15:04:41 +0000497Options:
498
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000499 -h
500 -fb
501 -db
502 -a
503 -i
504 -g
505 -t
506 -accel
507 -hsync
508 -vsync
509 -laced
510 -double
John Beppu4581b4c2000-01-19 15:04:41 +0000511
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000512Example:
513
514 $ fbset
515 mode "1024x768-76"
516 # D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz
517 geometry 1024 768 1024 768 16
518 timings 12714 128 32 16 4 128 4
519 accel false
520 rgba 5/11,6/5,5/0,0/0
521 endmode
522
523-------------------------------
524
525=item fdflush
526
527Usage: fdflush device
528
529Force floppy disk drive to detect disk change
530
531-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +0000532
John Beppu46a4e762000-01-18 22:33:11 +0000533=item find
534
John Beppu4581b4c2000-01-19 15:04:41 +0000535Usage: find [PATH...] [EXPRESSION]
536
537Search for files in a directory hierarchy. The default PATH is
538the current directory; default EXPRESSION is '-print'
539
John Beppu4581b4c2000-01-19 15:04:41 +0000540
Erik Andersen62dc17a2000-04-13 01:18:23 +0000541EXPRESSION may consist of:
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000542
543 -follow Dereference symbolic links.
544 -name PATTERN File name (leading directories removed) matches PATTERN.
545 -print print the full file name followed by a newline to stdout.
Erik Andersen62dc17a2000-04-13 01:18:23 +0000546
547Example:
548
549 $ find / -name /etc/passwd
550 /etc/passwd
John Beppu4581b4c2000-01-19 15:04:41 +0000551
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000552-------------------------------
553
John Beppu46a4e762000-01-18 22:33:11 +0000554=item free
555
John Beppu4581b4c2000-01-19 15:04:41 +0000556Usage: free
557
Erik Andersen7ab9c7e2000-05-12 19:41:47 +0000558Displays the amount of free and used system memory.
Erik Andersen62dc17a2000-04-13 01:18:23 +0000559
560Example:
561
562 $ free
Erik Andersen5e1189e2000-04-15 16:34:54 +0000563 total used free shared buffers
Erik Andersen62dc17a2000-04-13 01:18:23 +0000564 Mem: 257628 248724 8904 59644 93124
565 Swap: 128516 8404 120112
566 Total: 386144 257128 129016
567
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000568-------------------------------
569
570=item freeramdisk
571
572Usage: freeramdisk DEVICE
573
Erik Andersen7ab9c7e2000-05-12 19:41:47 +0000574Frees all memory used by the specified ramdisk.
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000575
576Example:
577
578 $ freeramdisk /dev/ram2
579
580-------------------------------
Erik Andersen62dc17a2000-04-13 01:18:23 +0000581
John Beppu46a4e762000-01-18 22:33:11 +0000582=item deallocvt
583
John Beppu4581b4c2000-01-19 15:04:41 +0000584Usage: deallocvt N
585
Erik Andersen62dc17a2000-04-13 01:18:23 +0000586Deallocates unused virtual terminal /dev/ttyN
John Beppu50ed0672000-04-13 23:44:04 +0000587
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000588-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +0000589
John Beppu46a4e762000-01-18 22:33:11 +0000590=item fsck.minix
591
John Beppuf17792c2000-04-13 03:16:01 +0000592Usage: fsck.minix [B<-larvsmf>] /dev/name
John Beppu4581b4c2000-01-19 15:04:41 +0000593
594Performs a consistency check for MINIX filesystems.
595
Erik Andersen62dc17a2000-04-13 01:18:23 +0000596OPTIONS:
John Beppuf17792c2000-04-13 03:16:01 +0000597
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000598 -l Lists all filenames
599 -r Perform interactive repairs
600 -a Perform automatic repairs
601 -v verbose
602 -s Outputs super-block information
603 -m Activates MINIX-like "mode not cleared" warnings
604 -f Force file system check.
605
606-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +0000607
John Beppu46a4e762000-01-18 22:33:11 +0000608=item grep
609
Erik Andersen62dc17a2000-04-13 01:18:23 +0000610Usage: grep [OPTIONS]... PATTERN [FILE]...
John Beppu4581b4c2000-01-19 15:04:41 +0000611
Erik Andersen62dc17a2000-04-13 01:18:23 +0000612Search for PATTERN in each FILE or standard input.
613
614OPTIONS:
John Beppuf17792c2000-04-13 03:16:01 +0000615
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000616 -h suppress the prefixing filename on output
617 -i ignore case distinctions
618 -n print line number with output lines
619 -q be quiet. Returns 0 if result was found, 1 otherwise
Erik Andersena19bc642000-05-02 06:40:02 +0000620 -v select non-matching lines
Erik Andersen62dc17a2000-04-13 01:18:23 +0000621
Eric Andersen98cd53e2000-06-16 19:56:44 +0000622This version of grep matches full regular expressions.
Erik Andersen62dc17a2000-04-13 01:18:23 +0000623
Erik Andersen62dc17a2000-04-13 01:18:23 +0000624Example:
625
626 $ grep root /etc/passwd
627 root:x:0:0:root:/root:/bin/bash
628 $ grep ^[rR]oo. /etc/passwd
629 root:x:0:0:root:/root:/bin/bash
John Beppu4581b4c2000-01-19 15:04:41 +0000630
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000631-------------------------------
632
633=item gunzip
634
Erik Andersen5e1189e2000-04-15 16:34:54 +0000635Usage: gunzip [OPTION]... FILE
636
637Uncompress FILE (or standard input if FILE is '-').
638
639Options:
640
641 -c Write output to standard output
642 -t Test compressed file integrity
643
644Example:
645
Erik Andersencf8d38a2000-04-21 01:23:36 +0000646 $ ls -la /tmp/BusyBox*
647 -rw-rw-r-- 1 andersen andersen 557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz
648 $ gunzip /tmp/BusyBox-0.43.tar.gz
649 $ ls -la /tmp/BusyBox*
650 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000651
652-------------------------------
653
654=item gzip
655
Erik Andersen5e1189e2000-04-15 16:34:54 +0000656Usage: gzip [OPTION]... FILE
657
658Compress FILE with maximum compression.
John Beppu9057b6a2000-04-16 10:22:28 +0000659When FILE is '-', reads standard input. Implies B<-c>.
Erik Andersen5e1189e2000-04-15 16:34:54 +0000660
661Options:
662
663 -c Write output to standard output instead of FILE.gz
664
665Example:
666
Erik Andersencf8d38a2000-04-21 01:23:36 +0000667 $ ls -la /tmp/BusyBox*
668 -rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar
669 $ gzip /tmp/BusyBox-0.43.tar
670 $ ls -la /tmp/BusyBox*
671 -rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/BusyBox-0.43.tar.gz
Erik Andersen5e1189e2000-04-15 16:34:54 +0000672
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000673
674-------------------------------
675
676=item halt
677
Erik Andersen5e1189e2000-04-15 16:34:54 +0000678Usage: halt
679
Eric Andersen98cd53e2000-06-16 19:56:44 +0000680This command halts the system.
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000681
682-------------------------------
683
John Beppu46a4e762000-01-18 22:33:11 +0000684=item head
685
Erik Andersen62dc17a2000-04-13 01:18:23 +0000686Usage: head [OPTION] [FILE]...
John Beppu4581b4c2000-01-19 15:04:41 +0000687
688Print first 10 lines of each FILE to standard output.
689With more than one FILE, precede each with a header giving the
690file name. With no FILE, or when FILE is -, read standard input.
Erik Andersen62dc17a2000-04-13 01:18:23 +0000691
692Options:
John Beppuf17792c2000-04-13 03:16:01 +0000693
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000694 -n NUM Print first NUM lines instead of first 10
Erik Andersen62dc17a2000-04-13 01:18:23 +0000695
696Example:
697
698 $ head -n 2 /etc/passwd
699 root:x:0:0:root:/root:/bin/bash
700 daemon:x:1:1:daemon:/usr/sbin:/bin/sh
John Beppu4581b4c2000-01-19 15:04:41 +0000701
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000702-------------------------------
703
704=item hostid
705
Erik Andersen5e1189e2000-04-15 16:34:54 +0000706Usage: hostid
707
708Prints out a unique 32-bit identifier for the current
709machine. The 32-bit identifier is intended to be unique
710among all UNIX systems in existence.
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000711
712-------------------------------
713
John Beppu46a4e762000-01-18 22:33:11 +0000714=item hostname
715
John Beppuf17792c2000-04-13 03:16:01 +0000716Usage: hostname [OPTION] {hostname | B<-F> file}
John Beppu46a4e762000-01-18 22:33:11 +0000717
John Beppu4581b4c2000-01-19 15:04:41 +0000718Get or set the hostname or DNS domain name. If a hostname is given
John Beppuf17792c2000-04-13 03:16:01 +0000719(or a file with the B<-F> parameter), the host name will be set.
John Beppu4581b4c2000-01-19 15:04:41 +0000720
Erik Andersen62dc17a2000-04-13 01:18:23 +0000721Options:
John Beppuf17792c2000-04-13 03:16:01 +0000722
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000723 -s Short
724 -i Addresses for the hostname
725 -d DNS domain name
726 -F FILE Use the contents of FILE to specify the hostname
Erik Andersen62dc17a2000-04-13 01:18:23 +0000727
728Example:
729
730 $ hostname
731 slag
John Beppu46a4e762000-01-18 22:33:11 +0000732
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000733-------------------------------
734
Erik Andersen73c8c9c2000-05-13 05:36:13 +0000735=item id
736
737Print information for USERNAME or the current user
738
739Options:
740
741 -g prints only the group ID
742 -u prints only the user ID
743 -r prints the real user ID instead of the effective ID (with -ug)
744
745Example:
746
747 $ id
748 uid=1000(andersen) gid=1000(andersen)
749
750-------------------------------
751
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000752=item init
753
Erik Andersen5e1189e2000-04-15 16:34:54 +0000754Usage: init
755
756Init is the parent of all processes.
757
758This version of init is designed to be run only by the kernel.
759
760BusyBox init doesn't support multiple runlevels. The runlevels field of
761the /etc/inittab file is completely ignored by BusyBox init. If you want
762runlevels, use sysvinit.
763
764BusyBox init works just fine without an inittab. If no inittab is found,
765it has the following default behavior:
766
767 ::sysinit:/etc/init.d/rcS
768 ::askfirst:/bin/sh
769
770if it detects that /dev/console is _not_ a serial console, it will also run:
771
772 tty2::askfirst:/bin/sh
773
774If you choose to use an /etc/inittab file, the inittab entry format is as follows:
775
776 <id>:<runlevels>:<action>:<process>
777
778 <id>:
779
780 WARNING: This field has a non-traditional meaning for BusyBox init!
781 The id field is used by BusyBox init to specify the controlling tty for
782 the specified process to run on. The contents of this field are
783 appended to "/dev/" and used as-is. There is no need for this field to
784 be unique, although if it isn't you may have strange results. If this
785 field is left blank, it is completely ignored. Also note that if
786 BusyBox detects that a serial console is in use, then all entries
787 containing non-empty id fields will _not_ be run. BusyBox init does
788 nothing with utmp. We don't need no stinkin' utmp.
789
790 <runlevels>:
791
792 The runlevels field is completely ignored.
793
794 <action>:
795
796 Valid actions include: sysinit, respawn, askfirst, wait,
797 once, and ctrlaltdel.
798
799 askfirst acts just like respawn, but before running the specified
800 process it displays the line "Please press Enter to activate this
801 console." and then waits for the user to press enter before starting
802 the specified process.
803
Eric Andersen98cd53e2000-06-16 19:56:44 +0000804 Unrecognized actions (like initdefault) will cause init to emit
Erik Andersen5e1189e2000-04-15 16:34:54 +0000805 an error message, and then go along with its business.
806
807 <process>:
808
809 Specifies the process to be executed and it's command line.
810
811
812Example /etc/inittab file:
813
814 # This is run first except when booting in single-user mode.
815 #
816 ::sysinit:/etc/init.d/rcS
817
818 # /bin/sh invocations on selected ttys
819 #
820 # Start an "askfirst" shell on the console (whatever that may be)
821 ::askfirst:/bin/sh
822 # Start an "askfirst" shell on /dev/tty2
823 tty2::askfirst:/bin/sh
824
825 # /sbin/getty invocations for selected ttys
826 #
827 tty4::respawn:/sbin/getty 38400 tty4
828 tty5::respawn:/sbin/getty 38400 tty5
829
830
831 # Example of how to put a getty on a serial line (for a terminal)
832 #
833 #ttyS0::respawn:/sbin/getty -L ttyS0 9600 vt100
834 #ttyS1::respawn:/sbin/getty -L ttyS1 9600 vt100
835 #
836 # Example how to put a getty on a modem line.
837 #ttyS2::respawn:/sbin/getty -x0 -s 57600 ttyS2
838
839 # Stuff to do before rebooting
840 ::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1
841 ::ctrlaltdel:/sbin/swapoff -a > /dev/null 2>&1
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000842
843-------------------------------
844
John Beppu46a4e762000-01-18 22:33:11 +0000845=item kill
846
John Beppuf17792c2000-04-13 03:16:01 +0000847Usage: kill [B<-signal>] process-id [process-id ...]
John Beppu4581b4c2000-01-19 15:04:41 +0000848
Erik Andersen62dc17a2000-04-13 01:18:23 +0000849Send a signal (default is SIGTERM) to the specified process(es).
850
851Options:
John Beppuf17792c2000-04-13 03:16:01 +0000852
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000853 -l List all signal names and numbers.
Erik Andersen62dc17a2000-04-13 01:18:23 +0000854
855Example:
856
857 $ ps | grep apache
858 252 root root S [apache]
859 263 www-data www-data S [apache]
860 264 www-data www-data S [apache]
861 265 www-data www-data S [apache]
862 266 www-data www-data S [apache]
863 267 www-data www-data S [apache]
864 $ kill 252
John Beppu4581b4c2000-01-19 15:04:41 +0000865
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000866-------------------------------
867
868=item killall
869
John Beppu9057b6a2000-04-16 10:22:28 +0000870Usage: killall [B<-signal>] process-name [process-name ...]
Erik Andersen5e1189e2000-04-15 16:34:54 +0000871
872Send a signal (default is SIGTERM) to the specified process(es).
873
874Options:
John Beppu9057b6a2000-04-16 10:22:28 +0000875
Erik Andersen5e1189e2000-04-15 16:34:54 +0000876 -l List all signal names and numbers.
877
878Example:
879
880 $ killall apache
881
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000882-------------------------------
883
884=item length
885
Erik Andersen7ab9c7e2000-05-12 19:41:47 +0000886Usage: length STRING
Erik Andersen5e1189e2000-04-15 16:34:54 +0000887
Erik Andersen7ab9c7e2000-05-12 19:41:47 +0000888Prints out the length of the specified STRING.
Erik Andersen5e1189e2000-04-15 16:34:54 +0000889
890Example:
Erik Andersena19bc642000-05-02 06:40:02 +0000891
Erik Andersen5e1189e2000-04-15 16:34:54 +0000892 $ length "Hello"
893 5
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000894
895-------------------------------
896
John Beppu46a4e762000-01-18 22:33:11 +0000897=item ln
898
John Beppu4581b4c2000-01-19 15:04:41 +0000899Usage: ln [OPTION] TARGET... LINK_NAME|DIRECTORY
Erik Andersena19bc642000-05-02 06:40:02 +0000900
John Beppu4581b4c2000-01-19 15:04:41 +0000901Create a link named LINK_NAME or DIRECTORY to the specified TARGET
902
903Options:
904
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000905 -s make symbolic links instead of hard links
906 -f remove existing destination files
John Beppu4581b4c2000-01-19 15:04:41 +0000907
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000908Example:
909
Erik Andersencf8d38a2000-04-21 01:23:36 +0000910 $ ln -s BusyBox /tmp/ls
Erik Andersena19bc642000-05-02 06:40:02 +0000911 $ ls -l /tmp/ls
Erik Andersencf8d38a2000-04-21 01:23:36 +0000912 lrwxrwxrwx 1 root root 7 Apr 12 18:39 ls -> BusyBox*
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000913
914-------------------------------
915
916=item loadacm
917
Erik Andersen3fe7f9f2000-04-19 03:59:10 +0000918Usage: loadacm
919
920Loads an acm from standard input.
921
922Example:
923
924 $ loadacm < /etc/i18n/acmname
Erik Andersen5e1189e2000-04-15 16:34:54 +0000925
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000926-------------------------------
927
928=item loadfont
929
Erik Andersena6c75222000-04-18 00:00:52 +0000930Usage: loadfont
931
932Loads a console font from standard input.
933
Erik Andersen3fe7f9f2000-04-19 03:59:10 +0000934Example:
935
936 $ loadfont < /etc/i18n/fontname
Erik Andersen5e1189e2000-04-15 16:34:54 +0000937
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000938-------------------------------
939
940=item loadkmap
941
Erik Andersen3fe7f9f2000-04-19 03:59:10 +0000942Usage: loadkmap
943
944Loads a binary keyboard translation table from standard input.
945
946Example:
947
948 $ loadkmap < /etc/i18n/lang-keymap
Erik Andersen5e1189e2000-04-15 16:34:54 +0000949
950-------------------------------
951
952=item logger
953
954Usage: logger [OPTION]... [MESSAGE]
955
956Write MESSAGE to the system log. If MESSAGE is '-', log stdin.
957
958Options:
959
960 -s Log to stderr as well as the system log.
961 -t Log using the specified tag (defaults to user name).
962 -p Enter the message with the specified priority.
963 This may be numerical or a ``facility.level'' pair.
964
965Example:
966
967 $ logger "hello"
968
969-------------------------------
970
971=item logname
972
973Usage: logname
974
975Print the name of the current user.
976
977Example:
978
979 $ logname
980 root
981
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000982-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +0000983
John Beppu46a4e762000-01-18 22:33:11 +0000984=item ls
985
Eric Andersena42982e2000-06-07 17:28:53 +0000986Usage: ls [B<-1acdelnpuxACFR>] [filenames...]
Erik Andersen9cf3bfa2000-04-13 18:49:43 +0000987
988Options:
989
990 -a do not hide entries starting with .
991 -c with -l: show ctime (the time of last
992 modification of file status information)
993 -d list directory entries instead of contents
994 -e list both full date and full time
995 -l use a long listing format
996 -n list numeric UIDs and GIDs instead of names
997 -p append indicator (one of /=@|) to entries
998 -u with -l: show access time (the time of last
999 access of the file)
1000 -x list entries by lines instead of by columns
1001 -A do not list implied . and ..
1002 -C list entries by columns
1003 -F append indicator (one of */=@|) to entries
Eric Andersena42982e2000-06-07 17:28:53 +00001004 -R list subdirectories recursively
John Beppu50ed0672000-04-13 23:44:04 +00001005
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001006-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001007
John Beppu46a4e762000-01-18 22:33:11 +00001008=item lsmod
1009
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001010Usage: lsmod
John Beppu4581b4c2000-01-19 15:04:41 +00001011
Erik Andersen5e1189e2000-04-15 16:34:54 +00001012Shows a list of all currently loaded kernel modules.
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001013
1014-------------------------------
1015
1016=item makedevs
1017
Erik Andersen5e1189e2000-04-15 16:34:54 +00001018Usage: makedevs NAME TYPE MAJOR MINOR FIRST LAST [s]
1019
1020Creates a range of block or character special files
1021
1022TYPEs include:
1023
1024 b: Make a block (buffered) device.
1025 c or u: Make a character (un-buffered) device.
1026 p: Make a named pipe. MAJOR and MINOR are ignored for named pipes.
1027
1028FIRST specifies the number appended to NAME to create the first device.
1029LAST specifies the number of the last item that should be created.
1030If 's' is the last argument, the base device is created as well.
1031
1032Example:
1033
1034 $ makedevs /dev/ttyS c 4 66 2 63
1035 [creates ttyS2-ttyS63]
1036 $ makedevs /dev/hda b 3 0 0 8 s
1037 [creates hda,hda1-hda8]
1038
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001039-------------------------------
1040
Eric Andersen2b6ab3c2000-06-13 06:54:53 +00001041=item md5sum
1042
1043Usage: md5sum [OPTION] [file ...]
1044
1045Print or check MD5 checksums.
1046
1047Options:
1048
1049 -b read files in binary mode
1050 -c check MD5 sums against given list
1051 -t read files in text mode (default)
1052 -g read a string
1053
1054The following two options are useful only when verifying checksums:
1055
1056 -s don't output anything, status code shows success
1057 -w warn about improperly formated MD5 checksum lines
1058
1059Example:
1060
1061 $ md5sum busybox
1062 6fd11e98b98a58f64ff3398d7b324003 busybox
1063 $ md5sum -c -
1064 6fd11e98b98a58f64ff3398d7b324003 busybox
1065 busybox: OK
1066 ^D
1067
1068-------------------------------
1069
John Beppu46a4e762000-01-18 22:33:11 +00001070=item mkdir
1071
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001072Usage: mkdir [OPTION] DIRECTORY...
1073
John Beppu4581b4c2000-01-19 15:04:41 +00001074Create the DIRECTORY(ies), if they do not already exist
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001075
John Beppu4581b4c2000-01-19 15:04:41 +00001076Options:
1077
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001078 -m set permission mode (as in chmod), not rwxrwxrwx - umask
Eric Andersen98cd53e2000-06-16 19:56:44 +00001079 -p no error if directory exists, make parent directories as needed
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001080
1081Example:
1082
1083 $ mkdir /tmp/foo
1084 $ mkdir /tmp/foo
1085 /tmp/foo: File exists
1086 $ mkdir /tmp/foo/bar/baz
1087 /tmp/foo/bar/baz: No such file or directory
1088 $ mkdir -p /tmp/foo/bar/baz
1089
1090-------------------------------
1091
1092=item mkfifo
1093
Erik Andersen5e1189e2000-04-15 16:34:54 +00001094Usage: mkfifo [OPTIONS] name
1095
1096Creates a named pipe (identical to 'mknod name p')
1097
1098Options:
John Beppu9057b6a2000-04-16 10:22:28 +00001099
Erik Andersen5e1189e2000-04-15 16:34:54 +00001100 -m create the pipe using the specified mode (default a=rw)
1101
1102-------------------------------
1103
1104=item mkfs.minix
1105
1106Usage: mkfs.minix [B<-c> | B<-l> filename] [B<-nXX>] [B<-iXX>] /dev/name [blocks]
1107
1108Make a MINIX filesystem.
1109
1110OPTIONS:
1111
1112 -c Check the device for bad blocks
1113 -n [14|30] Specify the maximum length of filenames
1114 -i Specify the number of inodes for the filesystem
1115 -l FILENAME Read the bad blocks list from FILENAME
1116 -v Make a Minix version 2 filesystem
1117
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001118-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001119
John Beppu46a4e762000-01-18 22:33:11 +00001120=item mknod
1121
Erik Andersen5e1189e2000-04-15 16:34:54 +00001122Usage: mknod [OPTIONS] NAME TYPE MAJOR MINOR
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001123
Erik Andersen5e1189e2000-04-15 16:34:54 +00001124Create a special file (block, character, or pipe).
1125
1126Options:
John Beppu9057b6a2000-04-16 10:22:28 +00001127
Erik Andersen5e1189e2000-04-15 16:34:54 +00001128 -m create the special file using the specified mode (default a=rw)
John Beppu4581b4c2000-01-19 15:04:41 +00001129
1130TYPEs include:
Erik Andersen5e1189e2000-04-15 16:34:54 +00001131 b: Make a block (buffered) device.
1132 c or u: Make a character (un-buffered) device.
1133 p: Make a named pipe. MAJOR and MINOR are ignored for named pipes.
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001134
1135Example:
1136
1137 $ mknod /dev/fd0 b 2 0
Erik Andersen5e1189e2000-04-15 16:34:54 +00001138 $ mknod -m 644 /tmp/pipe p
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001139
1140-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001141
John Beppu46a4e762000-01-18 22:33:11 +00001142=item mkswap
1143
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001144Usage: mkswap [B<-c>] [B<-v0>|B<-v1>] device [block-count]
1145
John Beppu4581b4c2000-01-19 15:04:41 +00001146Prepare a disk partition to be used as a swap partition.
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001147
John Beppu4581b4c2000-01-19 15:04:41 +00001148Options:
1149
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001150 -c Check for read-ability.
1151 -v0 Make version 0 swap [max 128 Megs].
1152 -v1 Make version 1 swap [big!] (default for kernels > 2.1.117).
1153 block-count Number of block to use (default is entire partition).
John Beppu50ed0672000-04-13 23:44:04 +00001154
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001155-------------------------------
1156
Erik Andersen227a59b2000-04-25 23:24:55 +00001157=item mktemp
1158
Erik Andersene31c0662000-05-02 05:32:07 +00001159Usage: mktemp [B<-q>] TEMPLATE
Erik Andersen227a59b2000-04-25 23:24:55 +00001160
1161Creates a temporary file with its name based on TEMPLATE.
1162TEMPLATE is any name with six `Xs' (i.e. /tmp/temp.XXXXXX).
1163
1164Example:
Erik Andersena19bc642000-05-02 06:40:02 +00001165
Erik Andersen227a59b2000-04-25 23:24:55 +00001166 $ mktemp /tmp/temp.XXXXXX
1167 /tmp/temp.mWiLjM
1168 $ ls -la /tmp/temp.mWiLjM
1169 -rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM
1170
1171-------------------------------
1172
Erik Andersen73c8c9c2000-05-13 05:36:13 +00001173=item nc
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001174
Erik Andersen73c8c9c2000-05-13 05:36:13 +00001175Usage: nc [IP] [port]
Erik Andersen5e1189e2000-04-15 16:34:54 +00001176
Erik Andersen73c8c9c2000-05-13 05:36:13 +00001177Netcat opens a pipe to IP:port
Erik Andersen5e1189e2000-04-15 16:34:54 +00001178
1179Example:
1180
Erik Andersen73c8c9c2000-05-13 05:36:13 +00001181 $ nc foobar.somedomain.com 25
Erik Andersen5e1189e2000-04-15 16:34:54 +00001182 220 foobar ESMTP Exim 3.12 #1 Sat, 15 Apr 2000 00:03:02 -0600
1183 help
1184 214-Commands supported:
1185 214- HELO EHLO MAIL RCPT DATA AUTH
1186 214 NOOP QUIT RSET HELP
1187 quit
1188 221 foobar closing connection
1189
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001190-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001191
John Beppu46a4e762000-01-18 22:33:11 +00001192=item more
1193
John Beppu4581b4c2000-01-19 15:04:41 +00001194Usage: more [file ...]
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001195
1196More is a filter for paging through text one screenful at a time.
1197
1198Example:
1199
1200 $ dmesg | more
John Beppu50ed0672000-04-13 23:44:04 +00001201
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001202-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001203
John Beppu46a4e762000-01-18 22:33:11 +00001204=item mount
1205
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001206Usage: mount [flags]
1207 mount [flags] device directory [B<-o> options,more-options]
John Beppu4581b4c2000-01-19 15:04:41 +00001208
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001209Flags:
John Beppu4581b4c2000-01-19 15:04:41 +00001210
Erik Andersen6c5f2c62000-05-05 19:49:33 +00001211 -a: Mount all file systems in fstab.
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001212 -o option: One of many filesystem options, listed below.
Erik Andersen6c5f2c62000-05-05 19:49:33 +00001213 -r: Mount the filesystem read-only.
1214 -t fs-type: Specify the filesystem type.
1215 -w: Mount for reading and writing (default).
John Beppu4581b4c2000-01-19 15:04:41 +00001216
Erik Andersen7ab9c7e2000-05-12 19:41:47 +00001217Options for use with the "B<-o>" flag:
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001218
Erik Andersen6c5f2c62000-05-05 19:49:33 +00001219 async/sync: Writes are asynchronous / synchronous.
1220 atime/noatime: Enable / disable updates to inode access times.
1221 dev/nodev: Allow use of special device files / disallow them.
1222 exec/noexec: Allow use of executable files / disallow them.
1223 loop: Mounts a file via loop device.
1224 suid/nosuid: Allow set-user-id-root programs / disallow them.
1225 remount: Re-mount a currently-mounted filesystem, changing its flags.
1226 ro/rw: Mount for read-only / read-write.
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001227 There are EVEN MORE flags that are specific to each filesystem.
1228 You'll have to see the written documentation for those.
1229
1230Example:
1231
1232 $ mount
1233 /dev/hda3 on / type minix (rw)
1234 proc on /proc type proc (rw)
1235 devpts on /dev/pts type devpts (rw)
1236 $ mount /dev/fd0 /mnt -t msdos -o ro
1237 $ mount /tmp/diskimage /opt -t ext2 -o loop
John Beppu50ed0672000-04-13 23:44:04 +00001238
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001239-------------------------------
1240
1241=item mt
1242
John Beppu9057b6a2000-04-16 10:22:28 +00001243Usage: mt [B<-f> device] opcode value
Erik Andersen5e1189e2000-04-15 16:34:54 +00001244
1245Control magnetic tape drive operation
1246
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001247-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001248
John Beppu46a4e762000-01-18 22:33:11 +00001249=item mv
1250
John Beppu4581b4c2000-01-19 15:04:41 +00001251Usage: mv SOURCE DEST
1252
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001253 or: mv SOURCE... DIRECTORY
John Beppu4581b4c2000-01-19 15:04:41 +00001254
1255Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001256
1257Example:
1258
1259 $ mv /tmp/foo /bin/bar
John Beppu50ed0672000-04-13 23:44:04 +00001260
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001261-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001262
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001263=item nslookup
John Beppu46a4e762000-01-18 22:33:11 +00001264
Erik Andersen5e1189e2000-04-15 16:34:54 +00001265Usage: nslookup [HOST]
John Beppu4581b4c2000-01-19 15:04:41 +00001266
Erik Andersen5e1189e2000-04-15 16:34:54 +00001267Queries the nameserver for the IP address of the given HOST
1268
1269Example:
1270
1271 $ nslookup localhost
1272 Server: default
1273 Address: default
1274
1275 Name: debian
1276 Address: 127.0.0.1
John Beppu46a4e762000-01-18 22:33:11 +00001277
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001278-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001279
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001280=item ping
1281
1282Usage: ping [OPTION]... host
1283
1284Send ICMP ECHO_REQUEST packets to network hosts.
1285
1286Options:
1287
1288 -c COUNT Send only COUNT pings.
Pavel Roskin0024abc2000-06-07 20:38:15 +00001289 -s SIZE Send SIZE data bytes in packets (default=56).
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001290 -q Quiet mode, only displays output at start
1291 and when finished.
1292Example:
1293
1294 $ ping localhost
1295 PING slag (127.0.0.1): 56 data bytes
1296 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=20.1 ms
1297
1298 --- debian ping statistics ---
1299 1 packets transmitted, 1 packets received, 0% packet loss
1300 round-trip min/avg/max = 20.1/20.1/20.1 ms
1301
1302-------------------------------
1303
Erik Andersen5e1189e2000-04-15 16:34:54 +00001304=item poweroff
1305
1306Shuts down the system, and requests that the kernel turn off power upon halting.
1307
1308-------------------------------
1309
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001310=item printf
1311
Erik Andersen5e1189e2000-04-15 16:34:54 +00001312Usage: printf format [argument...]
1313
1314Formats and prints the given data in a manner similar to the C printf command.
1315
1316Example:
1317
1318 $ printf "Val=%d\n" 5
1319 Val=5
1320
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001321-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001322
John Beppu46a4e762000-01-18 22:33:11 +00001323=item ps
1324
Erik Andersen5e1189e2000-04-15 16:34:54 +00001325Usage: ps
1326
1327Report process status
1328
1329This version of ps accepts no options.
1330
1331Example:
1332
1333 $ ps
1334 PID Uid Gid State Command
1335 1 root root S init
1336 2 root root S [kflushd]
1337 3 root root S [kupdate]
1338 4 root root S [kpiod]
1339 5 root root S [kswapd]
1340 742 andersen andersen S [bash]
1341 743 andersen andersen S -bash
1342 745 root root S [getty]
1343 2990 andersen andersen R ps
1344
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001345-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001346
John Beppu46a4e762000-01-18 22:33:11 +00001347=item pwd
1348
Erik Andersen5e1189e2000-04-15 16:34:54 +00001349Prints the full filename of the current working directory.
1350
1351Example:
1352
1353 $ pwd
1354 /root
1355
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001356-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001357
John Beppu46a4e762000-01-18 22:33:11 +00001358=item reboot
1359
Erik Andersen5e1189e2000-04-15 16:34:54 +00001360Instructs the kernel to reboot the system.
1361
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001362-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001363
John Beppu46a4e762000-01-18 22:33:11 +00001364=item rm
1365
Erik Andersen5e1189e2000-04-15 16:34:54 +00001366Usage: rm [OPTION]... FILE...
1367
Eric Andersen815e9042000-06-06 16:15:23 +00001368Remove (unlink) the FILE(s). You may use '--' to
1369indicate that all following arguments are non-options.
Erik Andersen5e1189e2000-04-15 16:34:54 +00001370
1371Options:
1372
1373 -f remove existing destinations, never prompt
1374 -r or -R remove the contents of directories recursively
1375
1376Example:
1377
1378 $ rm -rf /tmp/foo
1379
1380-------------------------------
1381
1382=item rmdir
1383
1384Usage: rmdir [OPTION]... DIRECTORY...
1385
1386Remove the DIRECTORY(ies), if they are empty.
1387
1388Example:
1389
1390 # rmdir /tmp/foo
1391
1392-------------------------------
1393
1394=item rmmod
1395
1396Usage: rmmod [OPTION]... [MODULE]...
1397
1398Unloads the specified kernel modules from the kernel.
1399
1400Options:
1401
1402 -a Try to remove all unused kernel modules.
1403
1404Example:
1405
1406 $ rmmod tulip
1407
1408-------------------------------
1409
1410=item sed
1411
John Beppu9057b6a2000-04-16 10:22:28 +00001412Usage: sed [B<-n>] B<-e> script [file...]
Erik Andersen5e1189e2000-04-15 16:34:54 +00001413
1414Allowed sed scripts come in the following form:
1415
1416 'ADDR [!] COMMAND'
1417
1418 where address ADDR can be:
1419 NUMBER Match specified line number
1420 $ Match last line
1421 /REGEXP/ Match specified regexp
1422 (! inverts the meaning of the match)
1423
1424 and COMMAND can be:
1425 s/regexp/replacement/[igp]
1426 which attempt to match regexp against the pattern space
1427 and if successful replaces the matched portion with replacement.
1428
1429 aTEXT
1430 which appends TEXT after the pattern space
1431
1432Options:
1433
1434 -e add the script to the commands to be executed
1435 -n suppress automatic printing of pattern space
1436
Eric Andersen98cd53e2000-06-16 19:56:44 +00001437This version of sed matches full regular expressions.
Erik Andersen5e1189e2000-04-15 16:34:54 +00001438
1439Example:
1440
1441 $ echo "foo" | sed -e 's/f[a-zA-Z]o/bar/g'
1442 bar
1443
1444-------------------------------
1445
Erik Andersen4f3f7572000-04-28 00:18:56 +00001446=item setkeycodes
1447
1448Usage: setkeycodes SCANCODE KEYCODE ...
1449
1450Set entries into the kernel's scancode-to-keycode map,
1451allowing unusual keyboards to generate usable keycodes.
1452
1453SCANCODE may be either xx or e0xx (hexadecimal),
1454and KEYCODE is given in decimal
1455
1456Example:
1457
1458 # setkeycodes e030 127
1459
1460-------------------------------
1461
Erik Andersen5e1189e2000-04-15 16:34:54 +00001462=item sh
1463
Erik Andersene5b6c7d2000-04-17 16:16:10 +00001464Usage: sh
1465
1466lash -- the BusyBox LAme SHell (command interpreter)
1467
Erik Andersen3fe7f9f2000-04-19 03:59:10 +00001468This command does not yet have proper documentation.
1469
1470Use lash just as you would use any other shell. It properly handles pipes,
1471redirects, job control, can be used as the shell for scripts (#!/bin/sh), and
1472has a sufficient set of builtins to do what is needed. It does not (yet)
1473support Bourne Shell syntax. If you need things like "if-then-else", "while",
1474and such, use ash or bash. If you just need a very simple and extremely small
1475shell, this will do the job.
Erik Andersen5e1189e2000-04-15 16:34:54 +00001476
1477-------------------------------
1478
1479=item sfdisk
1480
1481Usage: sfdisk [options] device ...
1482
1483device: something like /dev/hda or /dev/sda
1484
1485useful options:
1486
1487 -s [or --show-size]: list size of a partition
1488 -c [or --id]: print or change partition Id
1489 -l [or --list]: list partitions of each device
1490 -d [or --dump]: idem, but in a format suitable for later input
1491 -i [or --increment]: number cylinders etc. from 1 instead of from 0
1492 -uS, -uB, -uC, -uM: accept/report in units of sectors/blocks/cylinders/MB
1493 -T [or --list-types]:list the known partition types
1494 -D [or --DOS]: for DOS-compatibility: waste a little space
1495 -R [or --re-read]: make kernel reread partition table
1496 -N# : change only the partition with number #
1497 -n : do not actually write to disk
1498 -O file : save the sectors that will be overwritten to file
1499 -I file : restore these sectors again
1500 -v [or --version]: print version
1501 -? [or --help]: print this message
1502
1503dangerous options:
1504
1505 -g [or --show-geometry]: print the kernel's idea of the geometry
1506 -x [or --show-extended]: also list extended partitions on output
1507
1508 or expect descriptors for them on input
1509 -L [or --Linux]: do not complain about things irrelevant for Linux
1510 -q [or --quiet]: suppress warning messages
1511 You can override the detected geometry using:
1512 -C# [or --cylinders #]:set the number of cylinders to use
1513 -H# [or --heads #]: set the number of heads to use
1514 -S# [or --sectors #]: set the number of sectors to use
1515
1516You can disable all consistency checking with:
1517
1518 -f [or --force]: do what I say, even if it is stupid
1519
1520-------------------------------
1521
1522=item sleep
1523
1524Usage: sleep N
1525
1526Pause for N seconds.
1527
1528Example:
1529
1530 $ sleep 2
1531 [2 second delay results]
1532
1533-------------------------------
1534
1535=item sort
1536
John Beppu9057b6a2000-04-16 10:22:28 +00001537Usage: sort [B<-n>] [B<-r>] [FILE]...
Erik Andersen5e1189e2000-04-15 16:34:54 +00001538
1539Sorts lines of text in the specified files
1540
1541Example:
1542
1543 $ echo -e "e\nf\nb\nd\nc\na" | sort
1544 a
1545 b
1546 c
1547 d
1548 e
1549 f
1550
1551-------------------------------
1552
1553=item sync
1554
1555Usage: sync
1556
1557Write all buffered filesystem blocks to disk.
1558
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001559-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001560
John Beppu46a4e762000-01-18 22:33:11 +00001561=item syslogd
1562
Erik Andersen5e1189e2000-04-15 16:34:54 +00001563Usage: syslogd [OPTION]...
John Beppu4581b4c2000-01-19 15:04:41 +00001564
Erik Andersen5e1189e2000-04-15 16:34:54 +00001565Linux system and kernel (provides klogd) logging utility.
1566Note that this version of syslogd/klogd ignores /etc/syslog.conf.
John Beppu4581b4c2000-01-19 15:04:41 +00001567
Erik Andersen5e1189e2000-04-15 16:34:54 +00001568Options:
Pavel Roskin049b7062000-06-07 21:19:49 +00001569
Pavel Roskinda10ec02000-06-07 21:08:25 +00001570 -m NUM Interval between MARK lines (default=20min, 0=off)
1571 -n Run as a foreground process
1572 -K Do not start up the klogd process
1573 -O FILE Use an alternate log file (default=/var/log/messages)
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001574
1575-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001576
John Beppu46a4e762000-01-18 22:33:11 +00001577=item swapon
1578
Erik Andersen5e1189e2000-04-15 16:34:54 +00001579Usage: swapon [OPTION] [device]
1580
1581Start swapping virtual memory pages on the given device.
1582
1583Options:
1584
1585 -a Start swapping on all swap devices
1586
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001587-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001588
John Beppu46a4e762000-01-18 22:33:11 +00001589=item swapoff
1590
Erik Andersen5e1189e2000-04-15 16:34:54 +00001591Usage: swapoff [OPTION] [device]
1592
1593Stop swapping virtual memory pages on the given device.
1594
1595Options:
1596
1597 -a Stop swapping on all swap devices
1598
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001599-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001600
John Beppu46a4e762000-01-18 22:33:11 +00001601=item tail
1602
Erik Andersen5e1189e2000-04-15 16:34:54 +00001603Usage: tail [OPTION] [FILE]...
1604
1605Print last 10 lines of each FILE to standard output.
1606With more than one FILE, precede each with a header giving the
1607file name. With no FILE, or when FILE is -, read standard input.
1608
1609Options:
1610
1611 -n NUM Print last NUM lines instead of first 10
1612 -f Output data as the file grows. This version
1613 of 'tail -f' supports only one file at a time.
1614
1615Example:
1616
1617 $ tail -n 1 /etc/resolv.conf
1618 nameserver 10.0.0.1
1619
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001620-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001621
John Beppu46a4e762000-01-18 22:33:11 +00001622=item tar
1623
John Beppu9057b6a2000-04-16 10:22:28 +00001624Usage: tar -[cxtvO] [B<--exclude> File] [B<-f> tarFile] [FILE] ...
Erik Andersen5e1189e2000-04-15 16:34:54 +00001625
1626Create, extract, or list files from a tar file. Note that
1627this version of tar treats hard links as separate files.
1628
1629Main operation mode:
1630
1631 c create
1632 x extract
1633 t list
1634
1635File selection:
1636
1637 f name of tarfile or "-" for stdin
1638 O extract to stdout
1639 --exclude file to exclude
1640
1641Informative output:
1642
1643 v verbosely list files processed
1644
1645Example:
1646
1647 $ zcat /tmp/tarball.tar.gz | tar -xf -
1648 $ tar -cf /tmp/tarball.tar /usr/local
1649
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001650-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001651
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001652=item test, [
1653
Erik Andersen5e1189e2000-04-15 16:34:54 +00001654Usage: test EXPRESSION
1655or [ EXPRESSION ]
1656
1657Checks file types and compares values returning an exit
1658code determined by the value of EXPRESSION.
1659
1660Example:
1661
1662 $ test 1 -eq 2
1663 $ echo $?
1664 1
1665 $ test 1 -eq 1
1666 $ echo $?
1667 0
1668 $ [ -d /etc ]
1669 $ echo $?
1670 0
1671 $ [ -d /junk ]
1672 $ echo $?
1673 1
1674
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001675-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001676
John Beppu46a4e762000-01-18 22:33:11 +00001677=item tee
1678
Erik Andersen5e1189e2000-04-15 16:34:54 +00001679Usage: tee [OPTION]... [FILE]...
1680
1681Copy standard input to each FILE, and also to standard output.
1682
1683Options:
1684
1685 -a append to the given FILEs, do not overwrite
1686
1687Example:
1688
1689 $ echo "Hello" | tee /tmp/foo
1690 $ cat /tmp/foo
1691 Hello
1692
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001693-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001694
John Beppu46a4e762000-01-18 22:33:11 +00001695=item touch
1696
John Beppu9057b6a2000-04-16 10:22:28 +00001697Usage: touch [B<-c>] file [file ...]
Erik Andersen5e1189e2000-04-15 16:34:54 +00001698
1699Update the last-modified date on (or create) the selected file[s].
1700
1701Example:
1702
1703 $ ls -l /tmp/foo
1704 /bin/ls: /tmp/foo: No such file or directory
1705 $ touch /tmp/foo
1706 $ ls -l /tmp/foo
1707 -rw-rw-r-- 1 andersen andersen 0 Apr 15 01:11 /tmp/foo
1708
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001709-------------------------------
1710
1711=item tr
Erik Andersena19bc642000-05-02 06:40:02 +00001712
Erik Andersen3c1217c2000-05-01 22:34:24 +00001713Usage: tr [-cds] STRING1 [STRING2]
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001714
Erik Andersen3c1217c2000-05-01 22:34:24 +00001715Translate, squeeze, and/or delete characters from
1716standard input, writing to standard output.
Erik Andersen5e1189e2000-04-15 16:34:54 +00001717
Erik Andersen3c1217c2000-05-01 22:34:24 +00001718Options:
1719
1720 -c take complement of STRING1
1721 -d delete input characters coded STRING1
1722 -s squeeze multiple output characters of STRING2 into one character
Erik Andersen5e1189e2000-04-15 16:34:54 +00001723
1724Example:
1725
1726 $ echo "gdkkn vnqkc" | tr [a-y] [b-z]
1727 hello world
1728
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001729-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001730
John Beppu46a4e762000-01-18 22:33:11 +00001731=item true
1732
Erik Andersen5e1189e2000-04-15 16:34:54 +00001733Returns an exit code of TRUE (0)
1734
1735Example:
1736
1737 $ true
1738 $ echo $?
1739 0
1740
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001741-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001742
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001743=item tty
John Beppu4581b4c2000-01-19 15:04:41 +00001744
Erik Andersene5b6c7d2000-04-17 16:16:10 +00001745Usage: tty
1746
1747Print the file name of the terminal connected to standard input.
1748
1749Options:
1750
1751 -s print nothing, only return an exit status
1752
1753Example:
1754
1755 $ tty
1756 /dev/tty2
Erik Andersen5e1189e2000-04-15 16:34:54 +00001757
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001758-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001759
Eric Andersen2b6ab3c2000-06-13 06:54:53 +00001760=item uuencode
1761
1762Usage: uuencode [OPTION] [INFILE] REMOTEFILE
1763
1764Uuencode a file.
1765
1766Options:
1767
1768 -m use base64 encoding as of RFC1521
1769
1770Example:
1771
1772 $ uuencode busybox busybox
1773 begin 755 busybox
1774 M?T5,1@$!`0````````````(``P`!````L+@$"#0```!0N@,``````#0`(``&
1775 .....
1776 $ uudecode busybox busybox > busybox.uu
1777 $
1778
1779-------------------------------
1780
1781=item uudecode
1782
1783Usage: uudecode [OPTION] [FILE]
1784
1785Uudecode a uuencoded file
1786
1787Options:
1788
1789 -o FILE direct output to FILE
1790
1791Example:
1792
1793 $ uudecode -o busybox busybox.uu
1794 $ ls -l busybox
1795 -rwxr-xr-x 1 ams ams 245264 Jun 7 21:35 busybox
1796
1797-------------------------------
1798
John Beppu46a4e762000-01-18 22:33:11 +00001799=item umount
1800
Erik Andersene5b6c7d2000-04-17 16:16:10 +00001801Usage: umount [flags] filesystem|directory
1802
1803Flags:
1804
Erik Andersen6c5f2c62000-05-05 19:49:33 +00001805 -a: Unmount all file systems
1806 -r: Try to remount devices as read-only if mount is busy
1807 -f: Force filesystem umount (i.e. unreachable NFS server)
1808 -l: Do not free loop device (if a loop device has been used)
Erik Andersene5b6c7d2000-04-17 16:16:10 +00001809
1810Example:
1811
1812 $ umount /dev/hdc1
Erik Andersen5e1189e2000-04-15 16:34:54 +00001813
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001814-------------------------------
John Beppuf17792c2000-04-13 03:16:01 +00001815
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001816=item uname
John Beppuf17792c2000-04-13 03:16:01 +00001817
Erik Andersene5b6c7d2000-04-17 16:16:10 +00001818Usage: uname [OPTION]...
1819
Erik Andersen26702fe2000-04-17 16:44:46 +00001820Print certain system information. With no OPTION, same as B<-s>.
Erik Andersene5b6c7d2000-04-17 16:16:10 +00001821
1822Options:
1823
1824 -a print all information
1825 -m the machine (hardware) type
1826 -n print the machine's network node hostname
1827 -r print the operating system release
1828 -s print the operating system name
1829 -p print the host processor type
1830 -v print the operating system version
1831
1832Example:
1833
1834 $ uname -a
1835 Linux debian 2.2.15pre13 #5 Tue Mar 14 16:03:50 MST 2000 i686 unknown
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001836
1837-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001838
John Beppu46a4e762000-01-18 22:33:11 +00001839=item uniq
1840
Erik Andersene5b6c7d2000-04-17 16:16:10 +00001841Usage: uniq [OPTION]... [INPUT [OUTPUT]]
1842
1843Discard all but one of successive identical lines from INPUT
1844(or standard input), writing to OUTPUT (or standard output).
1845
1846Example:
1847
1848 $ echo -e "a\na\nb\nc\nc\na" | sort | uniq
1849 a
1850 b
1851 c
Erik Andersen5e1189e2000-04-15 16:34:54 +00001852
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001853-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001854
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001855=item update
John Beppu4581b4c2000-01-19 15:04:41 +00001856
Erik Andersene5b6c7d2000-04-17 16:16:10 +00001857Usage: update [options]
1858
1859Periodically flushes filesystem buffers.
1860
1861Options:
1862
1863 -S force use of sync(2) instead of flushing
1864 -s SECS call sync this often (default 30)
1865 -f SECS flush some buffers this often (default 5)
Erik Andersen5e1189e2000-04-15 16:34:54 +00001866
1867-------------------------------
1868
1869=item uptime
1870
Erik Andersene5b6c7d2000-04-17 16:16:10 +00001871Usage: uptime
1872
1873Tells how long the system has been running since boot.
1874
1875Example:
1876
1877 $ uptime
1878 1:55pm up 2:30, load average: 0.09, 0.04, 0.00
Erik Andersen5e1189e2000-04-15 16:34:54 +00001879
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001880-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001881
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001882=item usleep
1883
Erik Andersene5b6c7d2000-04-17 16:16:10 +00001884Usage: usleep N
1885
1886Pauses for N microseconds.
1887
1888Example:
1889
1890 $ usleep 1000000
1891 [pauses for 1 second]
Erik Andersen5e1189e2000-04-15 16:34:54 +00001892
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001893-------------------------------
1894
1895=item wc
1896
Erik Andersene5b6c7d2000-04-17 16:16:10 +00001897Usage: wc [OPTION]... [FILE]...
1898
1899Print line, word, and byte counts for each FILE, and a total line if
1900more than one FILE is specified. With no FILE, read standard input.
1901
1902Options:
1903
1904 -c print the byte counts
1905 -l print the newline counts
1906 -L print the length of the longest line
1907 -w print the word counts
1908
1909Example:
1910
1911 $ wc /etc/passwd
1912 31 46 1365 /etc/passwd
Erik Andersen5e1189e2000-04-15 16:34:54 +00001913
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001914-------------------------------
1915
1916=item whoami
1917
Erik Andersene5b6c7d2000-04-17 16:16:10 +00001918Usage: whoami
1919
1920Prints the user name associated with the current effective user id.
1921
1922Example:
1923
1924 $ whoami
1925 andersen
Erik Andersen5e1189e2000-04-15 16:34:54 +00001926
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001927-------------------------------
1928
1929=item yes
1930
Erik Andersene5b6c7d2000-04-17 16:16:10 +00001931Usage: yes [OPTION]... [STRING]...
1932
1933Repeatedly outputs a line with all specified STRING(s), or `y'.
Erik Andersen5e1189e2000-04-15 16:34:54 +00001934
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001935-------------------------------
John Beppu46a4e762000-01-18 22:33:11 +00001936
1937=item zcat
1938
Erik Andersen26702fe2000-04-17 16:44:46 +00001939This is essentially an alias for invoking "gunzip B<-c>", where
Eric Andersen98cd53e2000-06-16 19:56:44 +00001940it decompresses the file in question and send the output to stdout.
Erik Andersen5e1189e2000-04-15 16:34:54 +00001941
Erik Andersen9cf3bfa2000-04-13 18:49:43 +00001942-------------------------------
John Beppu4581b4c2000-01-19 15:04:41 +00001943
John Beppu46a4e762000-01-18 22:33:11 +00001944=back
John Beppu3a1b6be2000-01-18 15:45:59 +00001945
Erik Andersena19bc642000-05-02 06:40:02 +00001946=head1 LIBC NSS
1947
1948GNU Libc uses the Name Service Switch (NSS) to configure the behavior of the C
1949library for the local environment, and to configure how it reads system data,
1950such as passwords and group information. BusyBox has made it Policy that it
1951will never use NSS, and will never use and libc calls that make use of NSS.
1952This allows you to run an embedded system without the need for installing an
1953/etc/nsswitch.conf file and without and /lib/libnss_* libraries installed.
1954
1955If you are using a system that is using a remote LDAP server for authentication
1956via GNU libc NSS, and you want to use BusyBox, then you will need to adjust the
1957BusyBox source. Chances are though, that if you have enough space to install
1958of that stuff on your system, then you probably want the full GNU utilities.
1959
John Beppu3a1b6be2000-01-18 15:45:59 +00001960=head1 SEE ALSO
1961
1962textutils(1), shellutils(1), etc...
1963
1964=head1 MAINTAINER
1965
Erik Andersen1101d232000-04-19 05:15:12 +00001966Erik Andersen <andersee@debian.org> <andersen@lineo.com>
John Beppu3a1b6be2000-01-18 15:45:59 +00001967
1968=head1 AUTHORS
1969
John Beppu08fe43d2000-01-19 12:39:16 +00001970The following people have contributed code to BusyBox whether
1971they know it or not.
John Beppu3a1b6be2000-01-18 15:45:59 +00001972
Erik Andersen1101d232000-04-19 05:15:12 +00001973Erik Andersen <andersee@debian.org>
John Beppu3a1b6be2000-01-18 15:45:59 +00001974
John Beppu08fe43d2000-01-19 12:39:16 +00001975=for html <br>
John Beppu46a4e762000-01-18 22:33:11 +00001976
John Beppu08fe43d2000-01-19 12:39:16 +00001977John Beppu <beppu@lineo.com>
John Beppu3a1b6be2000-01-18 15:45:59 +00001978
John Beppu08fe43d2000-01-19 12:39:16 +00001979=for html <br>
John Beppu46a4e762000-01-18 22:33:11 +00001980
John Beppu08fe43d2000-01-19 12:39:16 +00001981Brian Candler <B.Candler@pobox.com>
John Beppu3a1b6be2000-01-18 15:45:59 +00001982
John Beppu08fe43d2000-01-19 12:39:16 +00001983=for html <br>
John Beppu46a4e762000-01-18 22:33:11 +00001984
John Beppu08fe43d2000-01-19 12:39:16 +00001985Randolph Chung <tausq@debian.org>
John Beppu3a1b6be2000-01-18 15:45:59 +00001986
John Beppu08fe43d2000-01-19 12:39:16 +00001987=for html <br>
John Beppu46a4e762000-01-18 22:33:11 +00001988
John Beppu08fe43d2000-01-19 12:39:16 +00001989Dave Cinege <dcinege@psychosis.com>
1990
1991=for html <br>
1992
John Beppu50ed0672000-04-13 23:44:04 +00001993Karl M. Hegbloom <karlheg@debian.org>
1994
1995=for html <br>
1996
John Beppu4fd10fc2000-04-17 05:13:59 +00001997John Lombardo <john@deltanet.com>
1998
1999=for html <br>
2000
Eric Andersen86ab8a32000-06-02 03:21:42 +00002001Glenn McGrath <bug1@netconnect.com.au>
2002
2003=for html <br>
2004
John Beppu08fe43d2000-01-19 12:39:16 +00002005Bruce Perens <bruce@perens.com>
2006
2007=for html <br>
2008
Pavel Roskin339b8922000-06-20 00:11:07 +00002009Pavel Roskin <proski@gnu.org>
Eric Andersen08e92892000-06-02 03:21:36 +00002010
2011=for html <br>
2012
John Beppu08fe43d2000-01-19 12:39:16 +00002013Linus Torvalds <torvalds@transmeta.com>
2014
2015=for html <br>
2016
2017Charles P. Wright <cpwright@villagenet.com>
2018
2019=for html <br>
2020
2021Enrique Zanardi <ezanardi@ull.es>
2022
2023=for html <br>
John Beppu3a1b6be2000-01-18 15:45:59 +00002024
2025=cut
John Beppu08fe43d2000-01-19 12:39:16 +00002026
John Beppu00216792000-06-21 19:06:16 +00002027# $Id: busybox.pod,v 1.44 2000/06/21 19:06:16 beppu Exp $