aboutsummaryrefslogtreecommitdiff
path: root/docs/busybox.pod
blob: 8d8e198c58b1841cc642c6ae4c238e1ad7fc14f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
=head1 NAME

busybox - I am BusyBox of Borg.  Unix will be assimilated.

=head1 SYNOPSIS

 busybox <function> [arguments...]  # or

 <function> [arguments...]	    # if symlinked

=head1 DESCRIPTION

BusyBox is a multi-call binary that combines many common Unix utilities into a
single executable.  Most people will create a symlink to busybox for each
function name, and BusyBox will act like whatever you invoke it as.

BusyBox has been written with size-optimization in mind.  It is very easy to
include or exclude the commands you want installed.  BusyBox tries to make
itself useful to small systems with limited resources.

=head1 COMMANDS

Currently defined functions:
busybox, cat, chmod, chown, chgrp, chroot, clear, chvt, cp, date,
dd, df, dmesg, du, fbset, find, free, deallocvt, fsck.minix, mkfs.minix,
grep, head, hostname, init, linuxrc, kill, ln, ls, lsmod, mkdir,
mknod, mkswap, more, mount, mv, ping, poweroff, ps, pwd, reboot,
rm, rmdir, sed, sleep, sort, sync, syslogd, swapon, swapoff, tail,
tar, tee, touch, true, false, uname, umount, uniq, update, zcat,
gunzip, gzip

=over 4

=item cat

Usage: cat [file ...]
 

=item chmod

Usage: chmod [-R] MODE[,MODE]... FILE...

Each MODE is one or more of the letters ugoa, one of the symbols +-= and
one or more of the letters rwxst.
  
Options:

 -R	change files and directories recursively.
 

=item chown

Usage: chown [OPTION]...  OWNER[.[GROUP] FILE...

Change the owner and/or group of each FILE to OWNER and/or GROUP.
 
Options:

 -R	change files and directories recursively
 

=item chgrp

Usage: chgrp [OPTION]... GROUP FILE...

Change the group membership of each FILE to GROUP.
 
Options:

 -R	change files and directories recursively
 

=item chroot

Usage: chroot NEWROOT [COMMAND...]

Run COMMAND with root directory set to NEWROOT.
 

=item clear



=item chvt

Usage: chvt N

Change foreground virtual terminal to /dev/ttyN
 

=item cp

Usage: cp [OPTION]... SOURCE DEST

or: cp [OPTION]... SOURCE... DIRECTORY

Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.

 -a	same as -dpR
 -d	preserve links
 -p	preserve file attributes if possible
 -R	copy directories recursively
 

=item date



=item dd

Usage: dd [if=name] [of=name] [bs=n] [count=n]

Copy a file, converting and formatting according to options

 if=FILE	read from FILE instead of stdin
 of=FILE	write to FILE instead of stout
 bs=n		read and write N BYTES at a time
 count=n	copy only n input blocks
 BYTES may be suffixed by w (x2), k (x1024), b (x512), or m (x1024^2).
 

=item df

Usage: df

=item dmesg

Usage: dmesg [-c] [-n level] [-s bufsize]
 

=item du

Usage: Usage: du [OPTION]... [FILE]...

  -s	display only a total for each argument
 

=item fbset

Usage: fbset [options] [mode]

Options:

 -h
 -fb
 -db
 -a
 -i
 -g
 -t
 -accel
 -hsync
 -vsync
 -laced
 -double


=item find

Usage: find [PATH...] [EXPRESSION]

Search for files in a directory hierarchy.  The default PATH is
the current directory; default EXPRESSION is '-print'

EXPRESSION may consist of:

 -follow
 Dereference symbolic links.
 -name PATTERN
 File name (with leading directories removed) matches PATTERN.
 -print
 print the full file name followed by a newline to stdout.
 This version of find matches full regular expresions.

=item free

Usage: free

=item deallocvt

Usage: deallocvt N

Deallocate unused virtual terminal /dev/ttyN
 

=item fsck.minix

Usage: fsck.minix [-larvsmf] /dev/name

Performs a consistency check for MINIX filesystems.

Options:

 -l	Lists all filenames
 -r	Perform interactive repairs
 -a	Perform automatic repairs
 -v	verbose
 -s	Outputs super-block information
 -m	Activates MINIX-like "mode not cleared" warnings
 -f	Force file system check.
 

=item mkfs.minix

Usage: mkfs.minix [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]

Make a MINIX filesystem.

Options:

 -c		Check the device for bad blocks
 -n [14|30]	Specify the maximum length of filenames
 -i		Specify the number of inodes for the filesystem
 -l FILENAME	Read the bad blocks list from FILENAME
 -v		Make a Minix version 2 filesystem
 

=item grep



=item head

Usage: Usage: head [FILE]...

Print first 10 lines of each FILE to standard output.
With more than one FILE, precede each with a header giving the
file name. With no FILE, or when FILE is -, read standard input.
 

=item hostname

Usage: hostname [OPTION] {hostname | -F file}

Get or set the hostname or DNS domain name. If a hostname is given
(or a file with the -F parameter), the host name will be set.
 
Options:

 -s		Short
 -i		Addresses for the hostname
 -d		DNS domain name
 -F FILE		Use the contents of FILE to specify the hostname
 

=item kill



=item ln

Usage: ln [OPTION] TARGET... LINK_NAME|DIRECTORY
Create a link named LINK_NAME or DIRECTORY to the specified TARGET
 
Options:

 -s	make symbolic links instead of hard links
 -f	remove existing destination files
 

=item ls

Usage: ls [-1acdelnpuxACF] [filenames...]
 

=item lsmod



=item mkdir

Usage: Usage: mkdir [OPTION] DIRECTORY...
Create the DIRECTORY(ies), if they do not already exist
 
Options:

 -m	set permission mode (as in chmod), not rwxrwxrwx - umask
 -p	no error if existing, make parent directories as needed
 

=item mknod

Usage: mknod NAME TYPE MAJOR MINOR
Make block or character special files.

TYPEs include:

 b:	Make a block (buffered) device.
 c or u:	Make a character (un-buffered) device.
 p:	Make a named pipe. Major and minor are ignored for named pipes.
 

=item mkswap

Usage: mkswap [-c] [-v0|-v1] device [block-count]
Prepare a disk partition to be used as a swap partition.
 
Options:

 -c		Check for read-ability.
 -v0		Make version 0 swap [max 128 Megs].
 -v1		Make version 1 swap [big!] (default for kernels > 2.1.117).
 block-count	Number of block to use (default is entire partition).
 

=item more

Usage: more [file ...]
 

=item mount

Usage: 	mount [flags]

mount [flags] device directory [-o options,more-options]

 Flags:
 -a:	Mount all file systems in fstab.
 -o option:	One of many filesystem options, listed below.
 -r:	Mount the filesystem read-only.
 -t filesystem-type:	Specify the filesystem type.
 -w:	Mount for reading and writing (default).
 Options for use with the "-o" flag:
 async / sync:	Writes are asynchronous / synchronous.
 dev / nodev:	Allow use of special device files / disallow them.
 exec / noexec:	Allow use of executable files / disallow them.
 loop: Mounts a file via loop device.
 suid / nosuid:	Allow set-user-id-root programs / disallow them.
 remount: Re-mount a currently-mounted filesystem, changing its flags.
 ro / rw: Mount for read-only / read-write.

There are EVEN MORE flags that are specific to each filesystem.
You'll have to see the written documentation for those.
 

=item mv

Usage: mv SOURCE DEST

or: mv SOURCE... DIRECTORY

Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
 

=item ping



=item poweroff



=item ps

Usage: ps

Report process status.
This version of ps accepts no options.
 

=item pwd



=item reboot



=item rm

Usage: rm [OPTION]... FILE...
Remove (unlink) the FILE(s).
 
Options:

 -f		remove existing destinations, never prompt
 -r or -R	remove the contents of directories recursively
 

=item rmdir

Usage: rmdir [OPTION]... DIRECTORY...
Remove the DIRECTORY(ies), if they are empty.
 

=item sed

Usage: sed [-n] -e script [file...]
Allowed sed scripts come in the following form:

 'ADDR [!] COMMAND'
  where address ADDR can be:
 NUMBER    Match specified line number
 $         Match last line
 /REGEXP/  Match specified regexp
 (! inverts the meaning of the match)
  and COMMAND can be:
 s/regexp/replacement/[igp]
 which attempt to match regexp against the pattern space
 and if successful replaces the matched portion with replacement.
  aTEXT
 which appends TEXT after the pattern space

Options:

-e	add the script to the commands to be executed
-n	suppress automatic printing of pattern space

This version of sed matches full regular expresions.
 

=item sleep

Usage: sleep N

Pause for N seconds.
 

=item sort

Usage: Usage: sort [OPTION]... [FILE]...
  

=item sync

Usage: sync

Write all buffered filesystem blocks to disk.
 

=item syslogd

Usage: syslogd [OPTION]...

Linux system and kernel (provides klogd) logging utility.
Note that this version of syslogd/klogd ignores /etc/syslog.conf.
 
Options:

 -m	Change the mark timestamp interval. default=20min. 0=off
 -n	Do not fork into the background (for when run by init)
 -K	Do not start up the klogd process (by default syslogd spawns klogd).
 -O	Specify an alternate log file.  default=/var/log/messages
 

=item swapon

Usage: swapon device

Start swapping virtual memory pages on the given device.
 

=item swapoff

Usage: swapoff device

Stop swapping virtual memory pages on the given device.
 

=item tail

Usage: tail [OPTION]... [FILE]...

Print last 10 lines of each FILE to standard output.
With more than one FILE, precede each with a header giving the file name.
With no FILE, or when FILE is -, read standard input.

 -c=N[kbm]       output the last N bytes
 -f              output appended data as the file grows
 -n=N            output the last N lines, instead of last 10
 -q              never output headers giving file names
 -v              always output headers giving file names
 --help          display this help and exit

If the first character of N (bytes or lines) is a `+', output begins with 
the Nth item from the start of each file, otherwise, print the last N items
in the file.  N bytes may be suffixed by k (x1024), b (x512), or m (1024^2).
  

=item tar



=item tee

Usage: tee [OPTION]... [FILE]...
Copy standard input to each FILE, and also to standard output.
 
Options:

 -a	append to the given FILEs, do not overwrite
 

=item touch

Usage: touch [-c] file [file ...]
 Update the last-modified date on the given file[s].
 

=item true



=item false



=item uname

Usage: uname [OPTION]...
 Print certain system information.  With no OPTION, same as -s.
 
Options:

 -a	print all information
 -m	the machine (hardware) type
 -n	print the machine's network node hostname
 -r	print the operating system release
 -s	print the operating system name
 -p	print the host processor type
 -v	print the operating system version
 

=item umount

Usage: Usage: umount [flags] filesystem|directory
 Flags:
 -a:	Unmount all file systems
 

=item uniq

Usage: Usage: uniq [OPTION]... [INPUT [OUTPUT]]

Discard all but one of successive identical lines from INPUT (or
standard input), writing to OUTPUT (or standard output).

 -h	display this help and exit

A field is a run of whitespace, then non-whitespace characters.
Fields are skipped before chars.
 

=item zcat

Usage: gunzip [OPTION]... FILE

Uncompress FILE (or standard input if FILE is '-').
 
Options:

 -c	Write output to standard output
 -t	Test compressed file integrity
 

=item gunzip

Usage: gunzip [OPTION]... FILE

Uncompress FILE (or standard input if FILE is '-').
 
Options:

 -c	Write output to standard output
 -t	Test compressed file integrity
 

=item gzip

Usage: gzip [OPTION]... FILE

Compress FILE with maximum compression.
When FILE is -, reads standard input.  Implies -c.
 
Options:

 -c	Write output to standard output instead of FILE.gz
 


=back

=head1 SEE ALSO

textutils(1), shellutils(1), etc...

=head1 MAINTAINER

Erik Andersen <erik@lineo.com>

=head1 AUTHORS

The following people have contributed code to BusyBox whether
they know it or not.

Erik Andersen <erik@lineo.com>

=for html <br>

John Beppu <beppu@lineo.com>

=for html <br>

Brian Candler <B.Candler@pobox.com>

=for html <br>

Randolph Chung <tausq@debian.org>

=for html <br>

Dave Cinege <dcinege@psychosis.com>	

=for html <br>

Bruce Perens <bruce@perens.com>

=for html <br>

Linus Torvalds <torvalds@transmeta.com>

=for html <br>

Charles P. Wright <cpwright@villagenet.com>

=for html <br>

Enrique Zanardi <ezanardi@ull.es>

=for html <br>

=cut