Oops. Forgot the usleep.c file.
[oweals/busybox.git] / docs / CommandList
1 The following document includes a continuous description of the current
2 commands, functions and utilities included in the busybox.
3
4 John Cooper       
5 johnc@lineo.com
6
7 _______________________________________________________________________________________________________
8
9
10
11
12                     BusyBox 0.38, Functions and the Arguments they Support 
13
14
15 New 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
18
19
20 ______________________________________________________________________________________________________
21
22
23
24
25
26 cat [file]        
27                 Display file contents to standard output.
28
29
30
31
32 _______________________________________________________________________________________________________
33
34
35
36
37
38 chmod [-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
73 chown [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
94 chgrp [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
115 chroot 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
131 clear
132
133                 Clear screen.
134
135
136
137
138
139
140 ________________________________________________________________________________________________________
141
142
143
144
145
146 cp [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
160                 -R      recursive       Copies directories recursively
161
162
163
164
165
166 _________________________________________________________________________________________________________
167
168
169
170
171
172 date [option [+format] [date]
173
174 date [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
195 dd [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
222 df
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
241 dmesg [-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
266 find [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
291 chvt N
292
293         Change foreground virtual terminal to /dev/ttyN.
294
295
296
297
298
299 ________________________________________________________________________________________________________
300
301
302
303
304
305 deallocvt N
306
307         Deallocate unused virtual terminal /dev/ttyN.
308
309
310
311
312
313 ________________________________________________________________________________________________________
314
315
316
317
318
319 fsck.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
327                 -a      Perform automatic repairs
328
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
346 mkfs.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
372 grep [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
392 init
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
406 kill [ -s sigspec | -signum | -sigspec ] [pid | job ]  or
407
408 kill -l [ exitstatus ]
409
410         Currently no information help page for this command
411
412
413
414
415
416 ________________________________________________________________________________________________________
417
418
419
420
421
422 ln [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
440 ls [ -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
452                 -e      List both full date and full time
453
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
495 mkdir [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
518 mknod NAME TYPE MAJOR MINOR
519
520 Make block or character special files.
521
522 TYPEs 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.
526
527
528
529 ________________________________________________________________________________________________________
530
531
532
533
534
535
536 mkswap [-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
565 more [file]
566
567         Display file one screen page at a time.
568
569
570
571
572 ________________________________________________________________________________________________________
573
574
575
576
577
578 mount [flags]
579
580 mount [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
632 mv fileA fileB    or
633
634 mv 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
650 ps
651
652         Report process status.  No options are currently supported.
653
654
655
656
657
658 ________________________________________________________________________________________________________
659
660
661
662
663
664 pwd
665
666         Print working directory  
667
668
669
670
671
672 ________________________________________________________________________________________________________
673
674
675
676
677
678 reboot
679
680         Reboot system.  No options are currently supported.
681
682
683
684
685
686 ________________________________________________________________________________________________________
687
688
689
690
691
692 rm [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
709 rmdir [OPTION] ... directory
710
711         Remove directories if they are empty.
712
713
714
715
716 ________________________________________________________________________________________________________
717
718
719
720
721 sed
722         Usage: sed [-n] -e script [file...]
723
724         Allowed sed scripts come in the following form:
725                 'ADDR [!] COMMAND'
726
727                 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)
732
733                 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.
737
738                   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
743
744         This version of sed matches full regular expresions.
745
746
747
748 ________________________________________________________________________________________________________
749
750
751
752
753
754 sleep N
755
756         Pause for N seconds.
757
758
759
760
761
762 ________________________________________________________________________________________________________
763
764
765
766
767
768 tar -[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
794 swapon device
795
796         Start swapping virtual memory pages on the given device.
797
798
799
800
801
802 ________________________________________________________________________________________________________
803
804
805
806
807
808 swapoff device
809
810         Stop swapping virtual memory pages on the given device.
811
812
813
814
815
816 ________________________________________________________________________________________________________
817
818
819
820
821
822 sync
823
824         Write all buffered filesystem blocks to disk.
825
826
827
828
829
830 ________________________________________________________________________________________________________
831
832
833
834
835
836 touch [-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
850 true
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
864 false
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
878 uname [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
906 umount [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
922 update
923
924 cvs 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
940 zcat [options] files
941
942         Usage: zcat [OPTION]... FILE
943
944         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
960 gunzip  (Same as zcat, but without the "-c" option.)
961
962
963
964
965
966 ________________________________________________________________________________________________________
967
968
969
970
971
972 gzip [OPTION]... FILE
973
974         Compress FILE with maximum compression.
975         When FILE is -, reads standard input.  Implies -c.
976
977         Options:
978                 -c      Write output to standard output instead of FILE.gz
979
980
981
982 ________________________________________________________________________________________________________
983
984
985
986
987
988
989 loadfont   
990
991         No information available with --help.
992
993
994
995
996 ________________________________________________________________________________________________________
997
998
999
1000
1001
1002 loadkmap
1003
1004         No information available with --help
1005
1006
1007
1008
1009
1010 ________________________________________________________________________________________________________
1011
1012
1013
1014
1015
1016 linuxrc
1017
1018         No information available with --help
1019
1020
1021
1022
1023
1024 ________________________________________________________________________________________________________
1025