blob: 03c74bb874484ffe9277cd581475b316d02daaf5 [file] [log] [blame]
Eric Andersen0f0fcec1999-12-12 05:32:52 +00001The following document includes a continuous description of the current
2commands, functions and utilities included in the busybox.
3
4John Cooper
5johnc@lineo.com
6
7_______________________________________________________________________________________________________
8
9
10
11
12 BusyBox 0.38, Functions and the Arguments they Support
13
14
Erik Andersen05df2392000-01-13 04:43:48 +000015New Apps that have been added to BusyBox since this document was written:
16 ping, hostname, mkfifo, free, tail, du, tee, head, sort, uniq, lsmod, rmmod, fbset, and loadacm.
17
Eric Andersen0f0fcec1999-12-12 05:32:52 +000018
19
20______________________________________________________________________________________________________
21
22
23
24
25
26cat [file]
27 Display file contents to standard output.
28
29
30
31
32_______________________________________________________________________________________________________
33
34
35
36
37
38chmod [-R] Mode,[Mode] file
39
40 Change file access permissions (mode) of one or more files.
41
42 -R Follows the directory tree from the current location thru all sub-directories,
43
44 applying changes.
45
46 Mode = u User
47
48 g Group
49
50 o Other
51
52 a All
53
54 Permission = r Read
55
56 w Write
57
58 s Set user (or group) ID
59
60 t Sticky bit file cannot be removed by other
61
62 than the owner.
63
64
65
66
67________________________________________________________________________________________________________
68
69
70
71
72
73chown [option] owner[group]file
74
75 Change owner and (or) group of file to owner and (or) group.
76
77 Only the current owner or a priveleged user may change an owner.
78
79 -R Follows the directory tree from the current location thru all sub-directories, applying
80
81 changes.
82
83
84
85
86
87________________________________________________________________________________________________________
88
89
90
91
92
93
94chgrp [option] newgroup file
95
96 Change group of file or files to new group name or ID number located in /etc/group.
97
98 Only the current owner or a priveleged user may change the group name or ID
99
100 -R Follows the directory tree from the current location thru all sub-directories,
101
102 applying changes.
103
104
105
106
107
108
109________________________________________________________________________________________________________
110
111
112
113
114
115chroot NEWROOT [Command...] (System Admin Command)
116
117 Run command with root directory set to NEWROOT. Only the current owner or a priveleged
118
119 user may use this command.
120
121
122
123
124
125________________________________________________________________________________________________________
126
127
128
129
130
131clear
132
133 Clear screen.
134
135
136
137
138
139
140________________________________________________________________________________________________________
141
142
143
144
145
146cp [option] fileA fileB
147
148 Copy fileA to fileB or fileA to directory maintaining fileA name.
149
150 -a archive Maintain file attributes whenever possible. Same as -dpR
151
152 -d no dereference Maintain hard link relationships between fileA and fileB.
153
154 No dereference of symbolic links.
155
156 -p maintain file Maintain all file attributes and information including owner
157
158 attributes group permissions and time information.
159
Erik Andersen05df2392000-01-13 04:43:48 +0000160 -R recursive Copies directories recursively
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000161
162
163
164
165
166_________________________________________________________________________________________________________
167
168
169
170
171
172date [option [+format] [date]
173
174date [option] [MMDDhhmm[[CC]YY][.SS]]
175
176 Display the current system date and time.
177
178 -R RFC-822 string Output an RFC-822 compliant date string.
179
180 -s set DATE Set date where date is entered in MMDDhhmm etc. format.
181
182 -u universal Print or set Coordinated Universal Time.
183
184
185
186
187
188_______________________________________________________________________________________________________
189
190
191
192
193
194
195dd [if=name] [of=name] [bs=n] [count=n]
196
197
198 Copy a file, converting and formatting according to options. Most useful when copying from
199
200 physical input and output devices.
201
202 if=fileA (instead of standard input)
203
204 of=fileB (instead of standard output)
205
206 bs=n Read and write N Bytes at a time.
207
208 count=n Copy only n input blocks.
209
210 Bytes may be suffixed by k for x1024, b for x512 and w for x2.
211
212
213
214
215
216________________________________________________________________________________________________________
217
218
219
220
221
222df
223
224
225 Display filesystem, number of blocks used, number of blocks available, number of blocks in use,
226
227 and mount point.
228
229
230
231
232
233
234________________________________________________________________________________________________________
235
236
237
238
239
240
241dmesg [-c] [-n level] [-s bufsize] (System Admin Command)
242
243
244 Display system control messages. Stored in the kernel ring buffer are all messages since the
245
246 last system boot, or the most recent if the buffer had been full.
247
248
249 -c Clear buffer after printing messages.
250
251 -n level Set the level of system message to be displayed on the console.
252
253 -s bufsize Display the size of the kernel ring buffer.
254
255
256
257
258
259________________________________________________________________________________________________________
260
261
262
263
264
265
266find [PATH] [EXPRESSION]
267
268 Search for files in the current directory, and all subdirectories for patterns that match
269
270 expression. Expressions may consist of the following.
271
272 -follow Dereference symbolic links.
273
274 -name PATTERN Find files that match PATTERN. Metacharacters should be escaped or
275
276 quoted.
277
278 -print Print full file name, followed by a newline, to standard out.
279
280
281
282
283
284
285________________________________________________________________________________________________________
286
287
288
289
290
291chvt N
292
293 Change foreground virtual terminal to /dev/ttyN.
294
295
296
297
298
299________________________________________________________________________________________________________
300
301
302
303
304
305deallocvt N
306
307 Deallocate unused virtual terminal /dev/ttyN.
308
309
310
311
312
313________________________________________________________________________________________________________
314
315
316
317
318
319fsck.minix [-larvsmf] /dev/name
320
321 Perform a consistency check for minix filesystems.
322
323 -l List filenames.
324
325 -r Perform interactive repairs.
326
Erik Andersen05df2392000-01-13 04:43:48 +0000327 -a Perform automatic repairs
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000328
329 -v Verbose
330
331 -s Output superblock information
332
333 -m Activates minix-like "mode not cleared" warnings.
334
335 -f Force file system check.
336
337
338
339
340________________________________________________________________________________________________________
341
342
343
344
345
346mkfs.minix [-c | -l filename ] [-nXX] [-iXX] /dev/name [blocks]
347
348 Make a minix file system.
349
350 -c Check device for bad blocks.
351
352 -n [ 14|30 ] Specify max length of filenames.
353
354 -i Specify number of inodes for filesystem.
355
356 -l filename
357
358 Read the bad blocks list from filename.
359
360 -v Make a minix version 2 filesystem.
361
362
363
364
365
366________________________________________________________________________________________________________
367
368
369
370
371
372grep [OPTIONS] PATTERN [FILE]
373
374 Search for PATTERN in each FILE or from standard input.
375
376 -h Suppress prefixing filename on output.
377
378 -i Ignore case distinctions.
379
380 -n Print line number with output lines.
381
382
383
384
385
386________________________________________________________________________________________________________
387
388
389
390
391
392init
393
394 The parent of all processes. Only to be run by the kernel.
395
396
397
398
399
400________________________________________________________________________________________________________
401
402
403
404
405
406kill [ -s sigspec | -signum | -sigspec ] [pid | job ] or
407
408kill -l [ exitstatus ]
409
410 Currently no information help page for this command
411
412
413
414
415
416________________________________________________________________________________________________________
417
418
419
420
421
422ln [option] TARGET... LINK_NAME|DIRECTORY
423
424 Create a link named LINK_NAME or DIRECTORY to TARGET.
425
426 -s Make symbolic links instead of hard links.
427
428 -f Remove existing destination files.
429
430
431
432
433
434________________________________________________________________________________________________________
435
436
437
438
439
440ls [ -1acdelnpuxACF ] [FILENAMES]
441
442 List contents of directories.
443
444 -1 Single entry per column of output.
445
446 -a All files including hidden files beginning with a ..
447
448 -c Files are listed by status change time.
449
450 -d List directories, not there contents.
451
Erik Andersen91f3df32000-02-10 22:58:40 +0000452 -e List both full date and full time
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000453
454 -l List in long format including permissions, owner, size
455
456 modification time etc.
457
458 -n Similar to -l, except use group ID and user ID instead
459
460 of owner and group names.
461
462 -p Directories are marked with a /.
463
464 -u Display files sorted by file access time.
465
466 -x Display files across the screen in rows.
467
468 -A Display hidden and all other files except . and ...
469
470 -C (Default, display files in columns)
471
472 -F Tag files by type by appending:
473
474 / to directories
475
476 * to executables
477
478 @ to symbolic links
479
480 | to fifo's
481
482 = to sockets
483
484
485
486
487
488
489________________________________________________________________________________________________________
490
491
492
493
494
495mkdir [OPTION] directory
496
497 Create directories if they do not already exist. You must have write permission to create
498
499 directories. Default mode can be modified by users umask.
500
501 -m Used to set permission mode. (See chmod description)
502
503 -p Make parent directories if they don't already exist. Return error code if
504
505 they already exist.
506
507
508
509
510
511
512________________________________________________________________________________________________________
513
514
515
516
517
Erik Andersen31638212000-01-15 22:28:50 +0000518mknod NAME TYPE MAJOR MINOR
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000519
Erik Andersen31638212000-01-15 22:28:50 +0000520Make block or character special files.
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000521
Erik Andersen31638212000-01-15 22:28:50 +0000522TYPEs include:
523 b: Make a block (buffered) device.
524 c or u: Make a character (un-buffered) device.
525 p: Make a named pipe. Major and minor are ignored for named pipes.
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000526
527
528
529________________________________________________________________________________________________________
530
531
532
533
534
535
536mkswap [-c] [ -v0|-v1 ] device [block-count]
537
538 Prepare a disk partition to be used as a swap partition.
539
540 -c Check for read-ability.
541
542 -v0 Make version 0 swap [max 128 megs]
543
544 -v1 Make version 1 swap [big |] default for
545
546 kernels > 2.1.117.
547
548 block-count
549
550 Number of blocks to use. (Default is the entire
551
552 partition).
553
554
555
556
557
558
559________________________________________________________________________________________________________
560
561
562
563
564
565more [file]
566
567 Display file one screen page at a time.
568
569
570
571
572________________________________________________________________________________________________________
573
574
575
576
577
578mount [flags]
579
580mount [flags] device directory [-o options, more options ]
581
582 Mount a filesystem for file access.
583
584 -a Mount all file systems in fstab.
585
586 -o option
587
588 async/sync: Writes are asynchronous/synchronous.
589
590 dev/nodev: Allow use of special device files
591
592 /disallow them.
593
594 exec/noexec: Allow use of executable files
595
596 /disallow them.
597
598 suid/nosuid: Allow set-user-id-root programs
599
600 /disallow them.
601
602 remount: Remount a currently-mounted filesystem
603
604 changing it's flags.
605
606 ro/rw: Mount for read-only/read-write.
607
608 (There are more flags specific to each filesystem.
609
610 See the written documentation for those.)
611
612 -r Mount the filesystem read only.
613
614 -t FILESYSTEM TYPE
615
616 Specify the filesystem type.
617
618 -w Mount for reading and writing default
619
620
621
622
623
624
625________________________________________________________________________________________________________
626
627
628
629
630
631
632mv fileA fileB or
633
634mv fileA dirA
635
636 Move fileA to fileB. (Renames fileA to fileB)
637
638 Move fileA to dirA (Moves fileA into dirA)
639
640
641
642
643
644________________________________________________________________________________________________________
645
646
647
648
649
650ps
651
652 Report process status. No options are currently supported.
653
654
655
656
657
658________________________________________________________________________________________________________
659
660
661
662
663
664pwd
665
666 Print working directory
667
668
669
670
671
672________________________________________________________________________________________________________
673
674
675
676
677
678reboot
679
680 Reboot system. No options are currently supported.
681
682
683
684
685
686________________________________________________________________________________________________________
687
688
689
690
691
692rm [option] file
693
694 Remove or unlink the files.
695
696 -f Remove existing destinations. Never prompt.
697
698 -r or -R Remove contents of directories recursively.
699
700
701
702
703________________________________________________________________________________________________________
704
705
706
707
708
709rmdir [OPTION] ... directory
710
711 Remove directories if they are empty.
712
713
714
715
716________________________________________________________________________________________________________
717
718
719
720
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000721sed
Erik Andersen05df2392000-01-13 04:43:48 +0000722 Usage: sed [-n] -e script [file...]
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000723
Erik Andersen05df2392000-01-13 04:43:48 +0000724 Allowed sed scripts come in the following form:
725 'ADDR [!] COMMAND'
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000726
Erik Andersen05df2392000-01-13 04:43:48 +0000727 where address ADDR can be:
728 NUMBER Match specified line number
729 $ Match last line
730 /REGEXP/ Match specified regexp
731 (! inverts the meaning of the match)
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000732
Erik Andersen05df2392000-01-13 04:43:48 +0000733 and COMMAND can be:
734 s/regexp/replacement/[igp]
735 which attempt to match regexp against the pattern space
736 and if successful replaces the matched portion with replacement.
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000737
Erik Andersen05df2392000-01-13 04:43:48 +0000738 aTEXT
739 which appends TEXT after the pattern space
740 Options:
741 -e add the script to the commands to be executed
742 -n suppress automatic printing of pattern space
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000743
Erik Andersen05df2392000-01-13 04:43:48 +0000744 This version of sed matches full regular expresions.
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000745
746
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000747
748________________________________________________________________________________________________________
749
750
751
752
753
754sleep N
755
756 Pause for N seconds.
757
758
759
760
761
762________________________________________________________________________________________________________
763
764
765
766
767
768tar -[cxtvOf] [tarFileName] [file]
769
770 Create, extract or list files from a tar file.
771
772 c=create
773
774 x=extract
775
776 t=list contents
777
778 v=verbose
779
780 O=extract to stdout
781
782 f=tarfile or "-" for standard input
783
784
785
786
787
788________________________________________________________________________________________________________
789
790
791
792
793
794swapon device
795
796 Start swapping virtual memory pages on the given device.
797
798
799
800
801
802________________________________________________________________________________________________________
803
804
805
806
807
808swapoff device
809
810 Stop swapping virtual memory pages on the given device.
811
812
813
814
815
816________________________________________________________________________________________________________
817
818
819
820
821
822sync
823
824 Write all buffered filesystem blocks to disk.
825
826
827
828
829
830________________________________________________________________________________________________________
831
832
833
834
835
836touch [-c] file [file...]
837
838 Update the last modified date on given file(s).
839
840
841
842
843
844________________________________________________________________________________________________________
845
846
847
848
849
850true
851
852 A null command that returns a successful 0 exit status code. (See false)
853
854
855
856
857
858________________________________________________________________________________________________________
859
860
861
862
863
864false
865
866 A null command that returns an unsuccessful or non-zero exit status.
867
868
869
870
871
872________________________________________________________________________________________________________
873
874
875
876
877
878uname [option]
879
880 Print certain system information. With no option, same as -s.
881
882 -a Display all information
883
884 -m Display machine hardware type.
885
886 -n Display machine network node hostname.
887
888 -r Display OS release
889
890 -s Display OS Name.
891
892 -p Display Host processor type.
893
894 -v Display OS Version.
895
896
897
898
899
900________________________________________________________________________________________________________
901
902
903
904
905
906umount [flags] filesystem | directory
907
908 Unmounts designated filesystem previously mounted on device.
909
910 -a Unmount all file systems.
911
912
913
914
915
916________________________________________________________________________________________________________
917
918
919
920
921
922update
923
924cvs update [options] files
925
926 Incorporates recent changes from the repository into files in your working directory. No
927
928 options are currently supported.
929
930
931
932
933
934________________________________________________________________________________________________________
935
936
937
938
939
940zcat [options] files
941
Erik Andersen05df2392000-01-13 04:43:48 +0000942 Usage: zcat [OPTION]... FILE
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000943
Erik Andersen05df2392000-01-13 04:43:48 +0000944 Uncompress FILE (or standard input if FILE is '-').
945 (When invoked as zcat, defaults to having -c turned on)
946
947 Options:
948 -c Write output to standard output
949 -t Test compressed file integrity
950
951
952
953
954________________________________________________________________________________________________________
955
956
957
958
959
960gunzip (Same as zcat, but without the "-c" option.)
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000961
962
963
964
965
966________________________________________________________________________________________________________
967
968
969
970
971
Erik Andersen05df2392000-01-13 04:43:48 +0000972gzip [OPTION]... FILE
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000973
Erik Andersen05df2392000-01-13 04:43:48 +0000974 Compress FILE with maximum compression.
975 When FILE is -, reads standard input. Implies -c.
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000976
Erik Andersen05df2392000-01-13 04:43:48 +0000977 Options:
978 -c Write output to standard output instead of FILE.gz
Eric Andersen0f0fcec1999-12-12 05:32:52 +0000979
980
981
982________________________________________________________________________________________________________
983
984
985
986
987
988
989loadfont
990
991 No information available with --help.
992
993
994
995
996________________________________________________________________________________________________________
997
998
999
1000
1001
1002loadkmap
1003
1004 No information available with --help
1005
1006
1007
1008
1009
1010________________________________________________________________________________________________________
1011
1012
1013
1014
1015
1016linuxrc
1017
1018 No information available with --help
1019
1020
1021
1022
1023
1024________________________________________________________________________________________________________
1025