aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-04-13 01:18:23 +0000
committerErik Andersen <andersen@codepoet.org>2000-04-13 01:18:23 +0000
commit62dc17a3b100496a5c7433cc598d674e244cb6f8 (patch)
tree52ee5e5ee40237154c82114abab0e1f59830ec83
parentf0657d322937ad2ff865be9f89cc8c979693088e (diff)
downloadbusybox-w32-62dc17a3b100496a5c7433cc598d674e244cb6f8.tar.gz
busybox-w32-62dc17a3b100496a5c7433cc598d674e244cb6f8.tar.bz2
busybox-w32-62dc17a3b100496a5c7433cc598d674e244cb6f8.zip
Some docs
-Erik
-rw-r--r--docs/busybox.pod361
1 files changed, 294 insertions, 67 deletions
diff --git a/docs/busybox.pod b/docs/busybox.pod
index 8d8e198c5..655e07bca 100644
--- a/docs/busybox.pod
+++ b/docs/busybox.pod
@@ -11,53 +11,151 @@ busybox - I am BusyBox of Borg. Unix will be assimilated.
11=head1 DESCRIPTION 11=head1 DESCRIPTION
12 12
13BusyBox is a multi-call binary that combines many common Unix utilities into a 13BusyBox is a multi-call binary that combines many common Unix utilities into a
14single executable. Most people will create a symlink to busybox for each 14single executable. Most people will create a link to busybox for each function
15function name, and BusyBox will act like whatever you invoke it as. 15they wish to use, and BusyBox will act like whatever it was invoked as. For
16example,
17
18 ln -s ./busybox ls
19 ./ls
20
21will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiled
22into busybox). You can also invoke BusyBox by providing it the command to run
23on the command line. For example,
24
25 ./busybox ls
26
27will also cause BusyBox to behave as 'ls'.
16 28
17BusyBox has been written with size-optimization in mind. It is very easy to 29BusyBox has been written with size-optimization in mind. It is very easy to
18include or exclude the commands you want installed. BusyBox tries to make 30include or exclude the commands (or features) you want installed. BusyBox
19itself useful to small systems with limited resources. 31tries to make itself useful to small systems with limited resources.
20 32
21=head1 COMMANDS 33=head1 COMMANDS
22 34
23Currently defined functions: 35Currently defined functions include:
24busybox, cat, chmod, chown, chgrp, chroot, clear, chvt, cp, date, 36
25dd, df, dmesg, du, fbset, find, free, deallocvt, fsck.minix, mkfs.minix, 37 basename, cat, chmod, chown, chgrp, chroot, clear, chvt, cp, mv, date,
26grep, head, hostname, init, linuxrc, kill, ln, ls, lsmod, mkdir, 38 dd, df, dirname, dmesg, du, dutmp, echo, fbset, fdflush, find, free,
27mknod, mkswap, more, mount, mv, ping, poweroff, ps, pwd, reboot, 39 freeramdisk, deallocvt, fsck.minix, mkfs.minix, grep, gunzip, gzip,
28rm, rmdir, sed, sleep, sort, sync, syslogd, swapon, swapoff, tail, 40 halt, head, hostid, hostname, init, kill, killall, length, ln, loadacm,
29tar, tee, touch, true, false, uname, umount, uniq, update, zcat, 41 loadfont, loadkmap, ls, lsmod, makedevs, math, mkdir, mkfifo, mknod,
30gunzip, gzip 42 mkswap, mnc, more, mount, mt, nslookup, poweroff, ping, printf, ps,
43 pwd, reboot, rm, rmdir, rmmod, sed, sh, fdisk, sfdisk, sleep, sort,
44 sync, syslogd, logger, logname, swapon, swapoff, tail, tar, [, test,
45 tee, touch, tr, true, false, tty, umount, uname, uptime, uniq, update,
46 usleep, wc, whoami, yes, zcat
47
48=head1 OPTIONS
49
50Common Options:
51
52 Most BusyBox commands support the "--help" option to provide a
53 terse runtime description of their behavior.
31 54
32=over 4 55=over 4
33 56
57=item basename
58
59Usage: basename [file ...]
60
61Strips directory and suffix from filenames.
62
63Example:
64
65 $ basename /usr/local/bin/foo
66 foo
67 $ basename /usr/local/bin/
68 bin
69
34=item cat 70=item cat
35 71
36Usage: cat [file ...] 72Usage: cat [file ...]
37 73
74Concatenates files and prints them to the standard output.
75
76Example:
77
78 $ cat /proc/uptime
79 110716.72 17.67
38 80
39=item chmod 81=item chmod
40 82
41Usage: chmod [-R] MODE[,MODE]... FILE... 83Usage: chmod [-R] MODE[,MODE]... FILE...
42 84
43Each MODE is one or more of the letters ugoa, one of the symbols +-= and 85Changes file access permissions for the specified file(s) or directory(s).
44one or more of the letters rwxst. 86Each MODE is defined by combining the letters for WHO has access to the file,
45 87an OPERATOR for selecting how the permissions should be changed, and a
88PERISSION for the file(s) or directory(s).
89
90WHO may be chosen from:
91
92 u the User who owns the file
93 g users in the file's Group
94 o Other users not in the file's group
95 a All users
96
97OPERATOR may be chosen from:
98
99 + add a permission
100 - remove a permission
101 = assign a permission
102
103PERMISSION may be chosen from:
104
105 r Read
106 w Write
107 x eXecute (or access for directories)
108 s Set user (or group) ID bit
109 t sTickey bit (for directories prevents removing files by non-owners)
110
111Alternately, permissions may be set numerically where the first three
112numbers are calculated by adding the octal values:
113
114 4 Read
115 2 Write
116 1 eXecute
117
118An optional fourth digit may also be used to specify
119
120 4 Set user ID
121 2 Set group ID
122 1 sTickey bit
123
46Options: 124Options:
47 125
48 -R change files and directories recursively. 126 -R change files and directories recursively.
49 127
128Example:
129
130 $ ls -l /tmp/foo
131 -rw-rw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo
132 $ chmod u+x /tmp/foo
133 $ ls -l /tmp/foo
134 -rwxrw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo*
135 $ chmod 444 /tmp/foo
136 $ ls -l /tmp/foo
137 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
50 138
51=item chown 139=item chown
52 140
53Usage: chown [OPTION]... OWNER[.[GROUP] FILE... 141Usage: chown [OPTION]... OWNER[.[GROUP] FILE...
54 142
55Change the owner and/or group of each FILE to OWNER and/or GROUP. 143Changes the owner and/or group of each FILE to OWNER and/or GROUP.
56 144
57Options: 145Options:
58 146
59 -R change files and directories recursively 147 -R change files and directories recursively
60 148
149Example:
150
151 $ ls -l /tmp/foo
152 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
153 $ chown root /tmp/foo
154 $ ls -l /tmp/foo
155 -r--r--r-- 1 root andersen 0 Apr 12 18:25 /tmp/foo
156 $ chown root.root /tmp/foo
157 ls -l /tmp/foo
158 -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo
61 159
62=item chgrp 160=item chgrp
63 161
@@ -69,6 +167,13 @@ Options:
69 167
70 -R change files and directories recursively 168 -R change files and directories recursively
71 169
170Example:
171
172 $ ls -l /tmp/foo
173 -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo
174 $ chgrp root /tmp/foo
175 $ ls -l /tmp/foo
176 -r--r--r-- 1 andersen root 0 Apr 12 18:25 /tmp/foo
72 177
73=item chroot 178=item chroot
74 179
@@ -76,10 +181,18 @@ Usage: chroot NEWROOT [COMMAND...]
76 181
77Run COMMAND with root directory set to NEWROOT. 182Run COMMAND with root directory set to NEWROOT.
78 183
184Exmaple:
79 185
80=item clear 186 $ ls -l /bin/ls
187 lrwxrwxrwx 1 root root 12 Apr 13 00:46 /bin/ls -> /bin/busybox
188 $ mount /dev/hdc1 /mnt -t minix
189 $ chroot /mnt
190 $ ls -l /bin/ls
191 -rwxr-xr-x 1 root root 40816 Feb 5 07:45 /bin/ls*
81 192
193=item clear
82 194
195Clears the screen.
83 196
84=item chvt 197=item chvt
85 198
@@ -92,53 +205,109 @@ Change foreground virtual terminal to /dev/ttyN
92 205
93Usage: cp [OPTION]... SOURCE DEST 206Usage: cp [OPTION]... SOURCE DEST
94 207
95or: cp [OPTION]... SOURCE... DIRECTORY 208 or: cp [OPTION]... SOURCE... DIRECTORY
96 209
97Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY. 210Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
98 211
99 -a same as -dpR 212 -a same as -dpR
100 -d preserve links 213 -d preserve links
101 -p preserve file attributes if possible 214 -p preserve file attributes if possable
102 -R copy directories recursively 215 -R copy directories recursively
103
104 216
105=item date 217=item date
106 218
219Usage: date [OPTION]... [+FORMAT]
220
221 or: date [OPTION] [MMDDhhmm[[CC]YY][.ss]]
107 222
223Display the current time in the given FORMAT, or set the system date.
224
225Options:
226 -R output RFC-822 compliant date string
227 -s set time described by STRING
228 -u print or set Coordinated Universal Time
229
230Example:
231
232 $ date
233 Wed Apr 12 18:52:41 MDT 2000
108 234
109=item dd 235=item dd
110 236
111Usage: dd [if=name] [of=name] [bs=n] [count=n] 237Usage: dd [if=name] [of=name] [bs=n] [count=n] [skip=n] [seek=n]
112 238
113Copy a file, converting and formatting according to options 239Copy a file, converting and formatting according to options
114 240
115 if=FILE read from FILE instead of stdin 241 if=FILE read from FILE instead of stdin
116 of=FILE write to FILE instead of stout 242 of=FILE write to FILE instead of stdout
117 bs=n read and write N BYTES at a time 243 bs=n read and write n bytes at a time
118 count=n copy only n input blocks 244 count=n copy only n input blocks
119 BYTES may be suffixed by w (x2), k (x1024), b (x512), or m (x1024^2). 245 skip=n skip n input blocks
246 seek=n skip n output blocks
247
248Numbers may be suffixed by w (x2), k (x1024), b (x512), or M (x1024^2)
120 249
121 250
251Example:
252
253 $ dd if=/dev/zero of=/dev/ram1 bs=1M count=4
254 4+0 records in
255 4+0 records out
256
122=item df 257=item df
123 258
124Usage: df 259Usage: df [filesystem ...]
260
261Prints the filesystem space used and space available.
262
263Exmaple:
264
265 $ df
266 Filesystem 1k-blocks Used Available Use% Mounted on
267 /dev/sda3 8690864 8553540 137324 98% /
268 /dev/sda1 64216 36364 27852 57% /boot
269 $ df /dev/sda3
270 Filesystem 1k-blocks Used Available Use% Mounted on
271 /dev/sda3 8690864 8553540 137324 98% /
125 272
126=item dmesg 273=item dmesg
127 274
128Usage: dmesg [-c] [-n level] [-s bufsize] 275Usage: dmesg [-c] [-n level] [-s bufsize]
129 276
277Print or controls the kernel ring buffer.
130 278
131=item du 279=item du
132 280
133Usage: Usage: du [OPTION]... [FILE]... 281Usage: du [OPTION]... [FILE]...
134 282
135 -s display only a total for each argument 283Summarize disk space used for each FILE and/or directory.
136 284Disk space is printed in units of 1k (i.e. 1024 bytes).
285
286Options:
287 -l count sizes many times if hard linked
288 -s display only a total for each argument
289
290Example:
291
292 $ ./busybox du
293 16 ./CVS
294 12 ./kernel-patches/CVS
295 80 ./kernel-patches
296 12 ./tests/CVS
297 36 ./tests
298 12 ./scripts/CVS
299 16 ./scripts
300 12 ./docs/CVS
301 104 ./docs
302 2417 .
303
137 304
138=item fbset 305=item fbset
139 306
140Usage: fbset [options] [mode] 307Usage: fbset [options] [mode]
141 308
309Show and modify frame buffer device settings
310
142Options: 311Options:
143 312
144 -h 313 -h
@@ -162,25 +331,40 @@ Usage: find [PATH...] [EXPRESSION]
162Search for files in a directory hierarchy. The default PATH is 331Search for files in a directory hierarchy. The default PATH is
163the current directory; default EXPRESSION is '-print' 332the current directory; default EXPRESSION is '-print'
164 333
334
165EXPRESSION may consist of: 335EXPRESSION may consist of:
336 -follow
337 Dereference symbolic links.
338 -name PATTERN
339 File name (with leading directories removed) matches PATTERN.
340 -print
341 print the full file name followed by a newline to stdout.
342
343Example:
166 344
167 -follow 345 $ find / -name /etc/passwd
168 Dereference symbolic links. 346 /etc/passwd
169 -name PATTERN
170 File name (with leading directories removed) matches PATTERN.
171 -print
172 print the full file name followed by a newline to stdout.
173 This version of find matches full regular expresions.
174 347
175=item free 348=item free
176 349
177Usage: free 350Usage: free
178 351
352Displays the amount of free and used memory in the system.
353
354Example:
355
356 $ free
357 total used free shared buffers
358 Mem: 257628 248724 8904 59644 93124
359 Swap: 128516 8404 120112
360 Total: 386144 257128 129016
361
362
179=item deallocvt 363=item deallocvt
180 364
181Usage: deallocvt N 365Usage: deallocvt N
182 366
183Deallocate unused virtual terminal /dev/ttyN 367Deallocates unused virtual terminal /dev/ttyN
184 368
185 369
186=item fsck.minix 370=item fsck.minix
@@ -189,15 +373,14 @@ Usage: fsck.minix [-larvsmf] /dev/name
189 373
190Performs a consistency check for MINIX filesystems. 374Performs a consistency check for MINIX filesystems.
191 375
192Options: 376OPTIONS:
193 377 -l Lists all filenames
194 -l Lists all filenames 378 -r Perform interactive repairs
195 -r Perform interactive repairs 379 -a Perform automatic repairs
196 -a Perform automatic repairs 380 -v verbose
197 -v verbose 381 -s Outputs super-block information
198 -s Outputs super-block information 382 -m Activates MINIX-like "mode not cleared" warnings
199 -m Activates MINIX-like "mode not cleared" warnings 383 -f Force file system check.
200 -f Force file system check.
201 384
202 385
203=item mkfs.minix 386=item mkfs.minix
@@ -206,27 +389,52 @@ Usage: mkfs.minix [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]
206 389
207Make a MINIX filesystem. 390Make a MINIX filesystem.
208 391
209Options: 392OPTIONS:
210 393 -c Check the device for bad blocks
211 -c Check the device for bad blocks 394 -n [14|30] Specify the maximum length of filenames
212 -n [14|30] Specify the maximum length of filenames 395 -i Specify the number of inodes for the filesystem
213 -i Specify the number of inodes for the filesystem 396 -l FILENAME Read the bad blocks list from FILENAME
214 -l FILENAME Read the bad blocks list from FILENAME 397 -v Make a Minix version 2 filesystem
215 -v Make a Minix version 2 filesystem
216 398
217 399
218=item grep 400=item grep
219 401
402Usage: grep [OPTIONS]... PATTERN [FILE]...
403
404Search for PATTERN in each FILE or standard input.
405
406OPTIONS:
407 -h suppress the prefixing filename on output
408 -i ignore case distinctions
409 -n print line number with output lines
410 -q be quiet. Returns 0 if result was found, 1 otherwise
411
412This version of grep matches full regular expresions.
220 413
221 414
415Example:
416
417 $ grep root /etc/passwd
418 root:x:0:0:root:/root:/bin/bash
419 $ grep ^[rR]oo. /etc/passwd
420 root:x:0:0:root:/root:/bin/bash
421
222=item head 422=item head
223 423
224Usage: Usage: head [FILE]... 424Usage: head [OPTION] [FILE]...
225 425
226Print first 10 lines of each FILE to standard output. 426Print first 10 lines of each FILE to standard output.
227With more than one FILE, precede each with a header giving the 427With more than one FILE, precede each with a header giving the
228file name. With no FILE, or when FILE is -, read standard input. 428file name. With no FILE, or when FILE is -, read standard input.
229 429
430Options:
431 -n NUM Print first NUM lines instead of first 10
432
433Example:
434
435 $ head -n 2 /etc/passwd
436 root:x:0:0:root:/root:/bin/bash
437 daemon:x:1:1:daemon:/usr/sbin:/bin/sh
230 438
231=item hostname 439=item hostname
232 440
@@ -234,18 +442,37 @@ Usage: hostname [OPTION] {hostname | -F file}
234 442
235Get or set the hostname or DNS domain name. If a hostname is given 443Get or set the hostname or DNS domain name. If a hostname is given
236(or a file with the -F parameter), the host name will be set. 444(or a file with the -F parameter), the host name will be set.
237 445
238Options: 446Options:
447 -s Short
448 -i Addresses for the hostname
449 -d DNS domain name
450 -F FILE Use the contents of FILE to specify the hostname
239 451
240 -s Short 452Example:
241 -i Addresses for the hostname 453
242 -d DNS domain name 454 $ hostname
243 -F FILE Use the contents of FILE to specify the hostname 455 slag
244
245 456
246=item kill 457=item kill
247 458
459Usage: kill [-signal] process-id [process-id ...]
248 460
461Send a signal (default is SIGTERM) to the specified process(es).
462
463Options:
464 -l List all signal names and numbers.
465
466Example:
467
468 $ ps | grep apache
469 252 root root S [apache]
470 263 www-data www-data S [apache]
471 264 www-data www-data S [apache]
472 265 www-data www-data S [apache]
473 266 www-data www-data S [apache]
474 267 www-data www-data S [apache]
475 $ kill 252
249 476
250=item ln 477=item ln
251 478