⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 busybox.1

📁 手机嵌入式Linux下可用的busybox源码
💻 1
📖 第 1 页 / 共 4 页
字号:
.Ve\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-.IP "\fBfsck_minix\fR" 4.IX Item "fsck_minix"fsck_minix [\fB\-larvsmf\fR] /dev/name.SpPerforms a consistency check for \s-1MINIX\s0 filesystems..SpOptions:.Sp.Vb 7\&        -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..Ve\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-.IP "\fBgetopt\fR" 4.IX Item "getopt"getopt [\s-1OPTIONS\s0]....SpParse command options.Sp.Vb 9\&        -a, --alternative               Allow long options starting with single -\&        -l, --longoptions=longopts      Long options to be recognized\&        -n, --name=progname             The name under which errors are reported\&        -o, --options=optstring Short options to be recognized\&        -q, --quiet                     Disable error reporting by getopt(3)\&        -Q, --quiet-output              No normal output\&        -s, --shell=shell               Set shell quoting conventions\&        -T, --test                      Test for getopt(1) version\&        -u, --unqote                    Do not quote the output.VeExample:.Sp.Vb 19\&        $ cat getopt.test\&        #!/bin/sh\&        GETOPT=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \e\&               -n 'example.busybox' -- "$@"`\&        if [ $? != 0 ] ; then  exit 1 ; fi\&        eval set -- "$GETOPT"\&        while true ; do\&         case $1 in\&           -a|--a-long) echo "Option a" ; shift ;;\&           -b|--b-long) echo "Option b, argument `$2'" ; shift 2 ;;\&           -c|--c-long)\&             case "$2" in\&               "") echo "Option c, no argument"; shift 2 ;;\&               *)  echo "Option c, argument `$2'" ; shift 2 ;;\&             esac ;;\&           --) shift ; break ;;\&           *) echo "Internal error!" ; exit 1 ;;\&         esac\&        done.Ve\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-.IP "\fBgrep\fR" 4.IX Item "grep"grep [\fB\-ihHnqvs\fR] \s-1PATTERN\s0 [FILEs...].SpSearch for \s-1PATTERN\s0 in each \s-1FILE\s0 or standard input..SpOptions:.Sp.Vb 8\&        -H      prefix output lines with filename where match was found\&        -h      suppress the prefixing filename on output\&        -i      ignore case distinctions\&        -l      list names of files that match\&        -n      print line number with output lines\&        -q      be quiet. Returns 0 if result was found, 1 otherwise\&        -v      select non-matching lines\&        -s      suppress file open/read error messages.VeExample:.Sp.Vb 4\&        $ grep root /etc/passwd\&        root:x:0:0:root:/root:/bin/bash\&        $ grep ^[rR]oo. /etc/passwd\&        root:x:0:0:root:/root:/bin/bash.Ve\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-.IP "\fBgunzip\fR" 4.IX Item "gunzip"gunzip [\s-1OPTION\s0]... \s-1FILE\s0.SpUncompress \s-1FILE\s0 (or standard input if \s-1FILE\s0 is '\-')..SpOptions:.Sp.Vb 2\&        -c      Write output to standard output\&        -t      Test compressed file integrity.VeExample:.Sp.Vb 5\&        $ ls -la /tmp/BusyBox*\&        -rw-rw-r--    1 andersen andersen   557009 Apr 11 10:55 /tmp/BusyBox-0.43.tar.gz\&        $ gunzip /tmp/BusyBox-0.43.tar.gz\&        $ ls -la /tmp/BusyBox*\&        -rw-rw-r--    1 andersen andersen  1761280 Apr 14 17:47 /tmp/BusyBox-0.43.tar.Ve\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-.IP "\fBgzip\fR" 4.IX Item "gzip"gzip [\s-1OPTION\s0]... \s-1FILE\s0.SpCompress \s-1FILE\s0 with maximum compression.When \s-1FILE\s0 is '\-', reads standard input.  Implies \fB\-c\fR..SpOptions:.Sp.Vb 2\&        -c      Write output to standard output instead of FILE.gz\&        -d      decompress.VeExample:.Sp.Vb 5\&        $ ls -la /tmp/busybox*\&        -rw-rw-r--    1 andersen andersen  1761280 Apr 14 17:47 /tmp/busybox.tar\&        $ gzip /tmp/busybox.tar\&        $ ls -la /tmp/busybox*\&        -rw-rw-r--    1 andersen andersen   554058 Apr 14 17:49 /tmp/busybox.tar.gz.Ve\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-.IP "\fBhalt\fR" 4.IX Item "halt"halt 	.SpHalt the system..Sp\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-.IP "\fBhead\fR" 4.IX Item "head"head [\s-1OPTION\s0] [\s-1FILE\s0]....SpPrint first 10 lines of each \s-1FILE\s0 to standard output.With more than one \s-1FILE\s0, precede each with a header giving thefile name. With no \s-1FILE\s0, or when \s-1FILE\s0 is \-, read standard input..SpOptions:.Sp.Vb 1\&        -n NUM          Print first NUM lines instead of first 10.VeExample:.Sp.Vb 3\&        $ head -n 2 /etc/passwd\&        root:x:0:0:root:/root:/bin/bash\&        daemon:x:1:1:daemon:/usr/sbin:/bin/sh.Ve\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-.IP "\fBhostid\fR" 4.IX Item "hostid"hostid 	.SpPrint out a unique 32\-bit identifier for the machine..Sp\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-.IP "\fBhostname\fR" 4.IX Item "hostname"hostname [\s-1OPTION\s0] {hostname | \fB\-F\fR \s-1FILE\s0}.SpGet or set the hostname or \s-1DNS\s0 domain name. If a hostname is given(or \s-1FILE\s0 with the \fB\-F\fR parameter), the host name will be set..SpOptions:.Sp.Vb 4\&        -s              Short\&        -i              Addresses for the hostname\&        -d              DNS domain name\&        -F, --file FILE Use the contents of FILE to specify the hostname.VeExample:.Sp.Vb 2\&        $ hostname\&        sage.Ve\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-.IP "\fBid\fR" 4.IX Item "id"id [\s-1OPTIONS\s0]... [\s-1USERNAME\s0].SpPrint information for \s-1USERNAME\s0 or the current user.SpOptions:.Sp.Vb 4\&        -g      prints only the group ID\&        -u      prints only the user ID\&        -n      print a name instead of a number (with for -ug)\&        -r      prints the real user ID instead of the effective ID (with -ug).VeExample:.Sp.Vb 2\&        $ id\&        uid=1000(andersen) gid=1000(andersen).Ve\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-.IP "\fBifconfig\fR" 4.IX Item "ifconfig"ifconfig [\fB\-a\fR] <interface> [<address>].Spconfigure a network interface.SpOptions:.Sp.Vb 8\&        [[-]broadcast [<address>]]  [[-]pointopoint [<address>]]\&        [netmask <address>]  [dstaddr <address>]\&        [outfill <NN>] [keepalive <NN>]\&        [hw ether <address>]  [metric <NN>]  [mtu <NN>]\&        [[-]trailers]  [[-]arp]  [[-]allmulti]\&        [multicast]  [[-]promisc]  [txqueuelen <NN>]  [[-]dynamic]\&        [mem_start <NN>]  [io_addr <NN>]  [irq <NN>]\&        [up|down] ....Ve\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-.IP "\fBinit\fR" 4.IX Item "init"init 	.SpInit is the parent of all processes..SpThis version of init is designed to be run only by the kernel..SpBusyBox init doesn't support multiple runlevels.  The runlevels field ofthe /etc/inittab file is completely ignored by BusyBox init. If you want runlevels, use sysvinit..SpBusyBox init works just fine without an inittab.  If no inittab is found, it has the following default behavior:.Sp.Vb 6\&        ::sysinit:/etc/init.d/rcS\&        ::askfirst:/bin/sh\&        ::ctrlaltdel:/sbin/reboot\&        ::shutdown:/sbin/swapoff -a\&        ::shutdown:/bin/umount -a -r\&        ::restart:/sbin/init.Veif it detects that /dev/console is _not_ a serial console, it will also run:.Sp.Vb 3\&        tty2::askfirst:/bin/sh\&        tty3::askfirst:/bin/sh\&        tty4::askfirst:/bin/sh.VeIf you choose to use an /etc/inittab file, the inittab entry format is as follows:.Sp.Vb 1\&        <id>:<runlevels>:<action>:<process>.Ve.Vb 1\&        <id>:.Ve.Vb 10\&                WARNING: This field has a non-traditional meaning for BusyBox init!\&                The id field is used by BusyBox init to specify the controlling tty for\&                the specified process to run on.  The contents of this field are\&                appended to "/dev/" and used as-is.  There is no need for this field to\&                be unique, although if it isn't you may have strange results.  If this\&                field is left blank, the controlling tty is set to the console.  Also\&                note that if BusyBox detects that a serial console is in use, then only\&                entries whose controlling tty is either the serial console or /dev/null\&                will be run.  BusyBox init does nothing with utmp.  We don't need no\&                stinkin' utmp..Ve.Vb 1\&        <runlevels>:.Ve.Vb 1\&                The runlevels field is completely ignored..Ve.Vb 1\&        <action>:.Ve.Vb 2\&                Valid actions include: sysinit, respawn, askfirst, wait, \&                once, restart, ctrlaltdel, and shutdown..Ve.Vb 3\&                The available actions can be classified into two groups: actions\&                that are run only once, and actions that are re-run when the specified\&                process exits..Ve.Vb 1\&                Run only-once actions:.Ve.Vb 15\&                        'sysinit' is the first item run on boot.  init waits until all\&                        sysinit actions are completed before continuing.  Following the\&                        completion of all sysinit actions, all 'wait' actions are run.\&                        'wait' actions, like  'sysinit' actions, cause init to wait until\&                        the specified task completes.  'once' actions are asynchronous,\&                        therefore, init does not wait for them to complete.  'restart' is\&                        the action taken to restart the init process.  By default this should\&                        simply run /sbin/init, but can be a script which runs pivot_root or it\&                        can do all sorts of other interesting things.  The 'ctrlaltdel' init\&                        actions are run when the system detects that someone on the system\&                       console has pressed the CTRL-ALT-DEL key combination.  Typically one\&                       wants to run 'reboot' at this point to cause the system to reboot.\&                        Finally the 'shutdown' action specifies the actions to taken when\&                       init is told to reboot.  Unmounting filesystems and disabling swap\&                       is a very good here.Ve.Vb 1\&                Run repeatedly actions:.Ve.Vb 8\&                        'respawn' actions are run after the 'once' actions.  When a process\&                        started with a 'respawn' action exits, init automatically restarts\&                        it.  Unlike sysvinit, BusyBox init does not stop processes from\&                        respawning out of control.  The 'askfirst' actions acts just like\&                        respawn, except that before running the specified process it\&                        displays the line "Please press Enter to activate this console."\&                        and then waits for the user to press enter before starting the\&                        specified process..Ve.Vb 3\&                Unrecognized actions (like initdefault) will cause init to emit an\&                error message, and then go along with its business.  All actions are\&                run in the order they appear in /etc/inittab..Ve.Vb 1\&        <process>:.Ve.Vb 1\&                Specifies the process to be executed and it's command line..VeExample /etc/inittab file:.Sp.Vb 3\&        # This is run first except when booting in single-user mode.\&        #\&        ::sysinit:/etc/init.d/rcS.Ve.Vb 8\&        # /bin/sh invocations on selected ttys\&        #\&        # Start an "askfirst" shell on the console (whatever that may be)\&        ::askfirst:-/bin/sh\&        # Start an "askfirst" shell on /dev/tty2-4\&        tty2::askfirst:-/bin/sh\&        tty3::askfirst:-/bin/sh\&        tty4::askfirst:-/bin/sh.Ve.Vb 4\&        # /sbin/getty invocations for selected ttys\&        #\&        tty4::respawn:/sbin/getty 38400 tty5\&        tty5::respawn:/sbin/getty 38400 tty6.Ve.Vb 7\&        # Example of how to put a getty on a serial line (for a terminal)\&        #\&        #::respawn:/sbin/getty -L ttyS0 9600 vt100\&        #::respawn:/sbin/getty -L ttyS1 9600 vt100\&        #\&        # Example how to put a getty on a modem line.\&        #::respawn:/sbin/getty 57600 ttyS2.Ve.Vb 2\&        # Stuff to do when restarting the init process\&        ::restart:/sbin/init.Ve.Vb 4\&        # Stuff to do before rebooting\&        ::ctrlaltdel:/sbin/reboot\&        ::shutdown:/bin/umount -a -r\&        ::shutdown:/sbin/swapoff -a.Ve\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-.IP "\fBinsmod\fR" 4.IX Item "insmod"insmod [\s-1OPTION\s0]... \s-1MODULE\s0 [symbol=value]....SpLoads the specified kernel modules into the kernel..SpOptions:.Sp.Vb 5\&        -f      Force module to load into the wrong kernel version.\&        -k      Make module autoclean-able.\&        -v      verbose output\&        -L      Lock to prevent simultaneous loads of a module\&        -x      do not export externs.Ve\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-.IP "\fBkill\fR" 4.IX Item "kill"kill [\fB\-signal\fR] process-id [process\-id ...].SpSend a signal (default is \s-1SIGTERM\s0) to the specified process(es)..SpOptions:.Sp.Vb 1\&        -l      List all signal names and numbers..VeExample:.Sp.Vb 8\&        $ ps | grep apache\&        252 root     root     S [apache]\&        263 www-data www-data S [apache]\&        264 www-data www-data S [apache]\&        265 www-data www-data S [apache]\&        266 www-data www-data S [apache]\&        267 www-data www-data S [apache]\&        $ kill 252.Ve\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-.IP "\fBkillall\fR" 4.IX Item "killall"killall [\fB\-signal\fR] process-name [process\-name ...]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -