📄 busybox.html
字号:
<HTML><HEAD><TITLE>BusyBox - The Swiss Army Knife of Embedded Linux</TITLE><LINK REV="made" HREF="mailto:perl@packages.debian.org"></HEAD><BODY><A NAME="__index__"></A><!-- INDEX BEGIN --><!--<UL> <LI><A HREF="#name">NAME</A></LI> <LI><A HREF="#syntax">SYNTAX</A></LI> <LI><A HREF="#description">DESCRIPTION</A></LI> <LI><A HREF="#usage">USAGE</A></LI> <LI><A HREF="#common options">COMMON OPTIONS</A></LI> <LI><A HREF="#commands">COMMANDS</A></LI> <LI><A HREF="#libc nss">LIBC NSS</A></LI> <LI><A HREF="#see also">SEE ALSO</A></LI> <LI><A HREF="#maintainer">MAINTAINER</A></LI> <LI><A HREF="#authors">AUTHORS</A></LI></UL>--><!-- INDEX END --><P><H1><A NAME="name">NAME</A></H1><P>BusyBox - The Swiss Army Knife of Embedded Linux</P><P><HR><H1><A NAME="syntax">SYNTAX</A></H1><PRE> BusyBox <function> [arguments...] # or</PRE><PRE> <function> [arguments...] # if symlinked</PRE><P><HR><H1><A NAME="description">DESCRIPTION</A></H1><P>BusyBox combines tiny versions of many common UNIX utilities into a singlesmall executable. It provides minimalist replacements for most of the utilitiesyou usually find in fileutils, shellutils, findutils, textutils, grep, gzip,tar, etc. BusyBox provides a fairly complete POSIX environment for any smallor embedded system. The utilities in BusyBox generally have fewer options thantheir full-featured GNU cousins; however, the options that are included providethe expected functionality and behave very much like their GNU counterparts.</P><P>BusyBox has been written with size-optimization and limited resources in mind.It is also extremely modular so you can easily include or exclude commands (orfeatures) at compile time. This makes it easy to customize your embeddedsystems. To create a working system, just add a kernel, a shell (such as ash),and an editor (such as elvis-tiny or ae).</P><P><HR><H1><A NAME="usage">USAGE</A></H1><P>When you create a link to BusyBox for the function you wish to use, when BusyBoxis called using that link it will behave as if the command itself has been invoked.</P><P>For example, entering</P><PRE> ln -s ./BusyBox ls ./ls</PRE><P>will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiledinto BusyBox).</P><P>You can also invoke BusyBox by issuing the command as an argument on thecommand line. For example, entering</P><PRE> ./BusyBox ls</PRE><P>will also cause BusyBox to behave as 'ls'.</P><P><HR><H1><A NAME="common options">COMMON OPTIONS</A></H1><P>Most BusyBox commands support the <STRONG>-h</STRONG> option to provide aterse runtime description of their behavior.</P><P><HR><H1><A NAME="commands">COMMANDS</A></H1><P>Currently defined functions include:</P><P>adjtimex, ar, basename, busybox, cat, chgrp, chmod, chown, chroot, chvt, clear,cmp, cp, cpio, cut, date, dc, dd, deallocvt, df, dirname, dmesg, dos2unix, dpkg,dpkg-deb, du, dumpkmap, dutmp, echo, expr, false, fbset, fdflush, find, free,freeramdisk, fsck.minix, getopt, grep, gunzip, gzip, halt, head, hostid,hostname, id, ifconfig, init, insmod, kill, killall, klogd, length, ln,loadacm, loadfont, loadkmap, logger, logname, ls, lsmod, makedevs, md5sum,mkdir, mkfifo, mkfs.minix, mknod, mkswap, mktemp, more, mount, mt, mv, nc,nslookup, ping, pivot_root, poweroff, printf, ps, pwd, rdate, readlink, reboot,renice, reset, rm, rmdir, rmmod, route, rpm2cpio, sed, setkeycodes,sh, sleep, sort, stty, swapoff, swapon, sync, syslogd, tail, tar, tee, telnet,test, tftp, touch, tr, true, tty, umount, uname, uniq, unix2dos, update, uptime,usleep, uudecode, uuencode, watchdog, wc, wget, which, whoami, xargs, yes, zcat,[</P><DL><DT><STRONG><A NAME="item_adjtimex"><STRONG>adjtimex</STRONG></A></STRONG><BR><DD>adjtimex [<STRONG>-q</STRONG>] [<STRONG>-o</STRONG> offset] [<STRONG>-f</STRONG> frequency] [<STRONG>-p</STRONG> timeconstant] [<STRONG>-t</STRONG> tick]<P>Reads and optionally sets system timebase parameters.See adjtimex(2).</P><P>Options:</P><PRE> -q quiet mode - do not print -o offset time offset, microseconds -f frequency frequency adjust, integer kernel units (65536 is 1ppm) (positive values make the system clock run fast) -t tick microseconds per tick, usually 10000 -p timeconstant</PRE><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_ar"><STRONG>ar</STRONG></A></STRONG><BR><DD>ar -[ov][ptx] ARCHIVE FILES<P>Extract or list FILES from an ar archive.</P><P>Options:</P><PRE> -o preserve original dates -p extract to stdout -t list -x extract -v verbosely list files processed</PRE><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_basename"><STRONG>basename</STRONG></A></STRONG><BR><DD>basename FILE [SUFFIX]<P>Strips directory path and suffixes from FILE.If specified, also removes any trailing SUFFIX.</P><P>Example:</P><PRE> $ basename /usr/local/bin/foo foo $ basename /usr/local/bin/ bin $ basename /foo/bar.txt .txt bar</PRE><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_cat"><STRONG>cat</STRONG></A></STRONG><BR><DD>cat [FILE]...<P>Concatenates <CODE>FILE(s)</CODE> and prints them to stdout.</P><P>Example:</P><PRE> $ cat /proc/uptime 110716.72 17.67</PRE><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_chgrp"><STRONG>chgrp</STRONG></A></STRONG><BR><DD>chgrp [OPTION]... GROUP FILE...<P>Change the group membership of each FILE to GROUP.</P><P>Options:</P><PRE> -R Changes files and directories recursively.</PRE><P>Example:</P><PRE> $ ls -l /tmp/foo -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo $ chgrp root /tmp/foo $ ls -l /tmp/foo -r--r--r-- 1 andersen root 0 Apr 12 18:25 /tmp/foo</PRE><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_chmod"><STRONG>chmod</STRONG></A></STRONG><BR><DD>chmod [<STRONG>-R</STRONG>] MODE[,MODE]... FILE...<P>Each MODE is one or more of the letters ugoa, one of thesymbols +-= and one or more of the letters rwxst.</P><P>Options:</P><PRE> -R Changes files and directories recursively.</PRE><P>Example:</P><PRE> $ ls -l /tmp/foo -rw-rw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo $ chmod u+x /tmp/foo $ ls -l /tmp/foo -rwxrw-r-- 1 root root 0 Apr 12 18:25 /tmp/foo* $ chmod 444 /tmp/foo $ ls -l /tmp/foo -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo</PRE><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_chown"><STRONG>chown</STRONG></A></STRONG><BR><DD>chown [ <STRONG>-Rh</STRONG> ]... OWNER[<.|:>[GROUP]] FILE...<P>Change the owner and/or group of each FILE to OWNER and/or GROUP.</P><P>Options:</P><PRE> -R Changes files and directories recursively. -h Do not dereference symbolic links.</PRE><P>Example:</P><PRE> $ ls -l /tmp/foo -r--r--r-- 1 andersen andersen 0 Apr 12 18:25 /tmp/foo $ chown root /tmp/foo $ ls -l /tmp/foo -r--r--r-- 1 root andersen 0 Apr 12 18:25 /tmp/foo $ chown root.root /tmp/foo ls -l /tmp/foo -r--r--r-- 1 root root 0 Apr 12 18:25 /tmp/foo</PRE><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_chroot"><STRONG>chroot</STRONG></A></STRONG><BR><DD>chroot NEWROOT [COMMAND...]<P>Run COMMAND with root directory set to NEWROOT.</P><P>Example:</P><PRE> $ ls -l /bin/ls lrwxrwxrwx 1 root root 12 Apr 13 00:46 /bin/ls -> /BusyBox $ mount /dev/hdc1 /mnt -t minix $ chroot /mnt $ ls -l /bin/ls -rwxr-xr-x 1 root root 40816 Feb 5 07:45 /bin/ls*</PRE><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_chvt"><STRONG>chvt</STRONG></A></STRONG><BR><DD>chvt N<P>Changes the foreground virtual terminal to /dev/ttyN</P><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_clear"><STRONG>clear</STRONG></A></STRONG><BR><DD>clear<P>Clear screen.</P><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_cmp"><STRONG>cmp</STRONG></A></STRONG><BR><DD>cmp FILE1 [FILE2]<PRE> -s quiet mode - do not printCompare files.</PRE><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_cp"><STRONG>cp</STRONG></A></STRONG><BR><DD>cp [OPTION]... SOURCE DEST<P>Copies SOURCE to DEST, or multiple <CODE>SOURCE(s)</CODE> to DIRECTORY.</P><PRE> -a Same as -dpR -d Preserves links -p Preserves file attributes if possible -f force (implied; ignored) - always set -R Copies directories recursively</PRE><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_cpio"><STRONG>cpio</STRONG></A></STRONG><BR><DD>cpio -[dimtuv][F cpiofile]<P>Extract or list files from a cpio archiveMain operation mode:</P><PRE> d make leading directories i extract m preserve mtime t list u unconditional overwrite F input from file</PRE><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_cut"><STRONG>cut</STRONG></A></STRONG><BR><DD>cut [OPTION]... [FILE]...<P>Prints selected fields from each input FILE to standard output.</P><P>Options:</P><PRE> -b LIST Output only bytes from LIST -c LIST Output only characters from LIST -d CHAR Use CHAR instead of tab as the field delimiter -s Output only the lines containing delimiter -f N Print only these fields -n Ignored</PRE><P>Example:</P><PRE> $ echo "Hello world" | cut -f 1 -d ' ' Hello $ echo "Hello world" | cut -f 2 -d ' ' world</PRE><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_date"><STRONG>date</STRONG></A></STRONG><BR><DD>date [OPTION]... [+FORMAT]<P>Displays the current time in the given FORMAT, or sets the system date.</P><P>Options:</P><PRE> -R Outputs RFC-822 compliant date string -d STRING display time described by STRING, not `now' -s Sets time described by STRING -u Prints or sets Coordinated Universal Time</PRE><P>Example:</P><PRE> $ date Wed Apr 12 18:52:41 MDT 2000</PRE><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_dc"><STRONG>dc</STRONG></A></STRONG><BR><DD>dc expression ...<P>This is a Tiny RPN calculator that understands thefollowing operations: +, -, /, *, and, or, not, eor.i.e., 'dc 2 2 add' -> 4, and 'dc 8 8 \* 2 2 + /' -> 16</P><P>Example:</P><PRE> $ dc 2 2 + 4 $ dc 8 8 * 2 2 + / 16 $ dc 0 1 and 0 $ dc 0 1 or 1 $ echo 72 9 div 8 mul | dc 64</PRE><P>-------------------------------</P><P></P><DT><STRONG><A NAME="item_dd"><STRONG>dd</STRONG></A></STRONG><BR><DD><TABLE CELLSPACING=0 CELLPADDING=0><TR><TD>dd [if=FILE] [of=FILE] [bs=N] [count=N] [skip=N]<TR><TD><TD> [seek=N] [conv=notrunc|noerror|sync]</TABLE><P>Copy a file, converting and formatting according to options</P><PRE> if=FILE read from FILE instead of stdin of=FILE write to FILE instead of stdout bs=N read and write N bytes at a time count=N copy only N input blocks skip=N skip N input blocks seek=N skip N output blocks conv=notrunc don't truncate output file conv=noerror continue after read errors
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -