zoukankan      html  css  js  c++  java
  • Linux常用命令

    1:  shutdown

    [root@cairui ~]# shutdown --help
    Usage: shutdown [OPTION]... TIME [MESSAGE]  #使用
    Bring the system down.
    
    Options:
      -r                          reboot after shutdown            #重启,也可以直接使用 reboot 命令
      -h                          halt or power off after shutdown      #shutdown -h(halt) 直接关机(关闭电源)
      -H                          halt after shutdown (implies -h)      #shutdown -h now[+10]  现在关机(+10标识10分钟之后关机

    -P power off after shutdown (implies -h)  #电源关闭在关机之后 -c cancel a running shutdown          #取消关机 -k only send warnings, don't shutdown     -q, --quiet reduce output to errors only -v, --verbose increase output to include informational messages --help display this help and exit --version output version information and exit TIME may have different formats, the most common is simply the word 'now' which will bring the system down immediately. Other valid formats are +m, where m is the number of minutes to wait until shutting down and hh:mm which specifies the time on the 24hr clock. Logged in users are warned by a message sent to their terminal, you may include an optional MESSAGE included with this. Messages can be sent without actually bringing the system down by using the -k option. If TIME is given, the command will remain in the foreground until the shutdown occurs. It can be cancelled by Control-C, or by another user using the -c option. The system is brought down into maintenance (single-user) mode by default, you can change this with either the -r or -h option which specify a reboot or system halt respectively. The -h option can be further modified with -H or -P to specify whether to halt the system, or to power it off afterwards. The default is left up to the shutdown scripts. Report bugs at <https://launchpad.net/upstart/+bugs>

    2:  ls

    [root@cairui ~]# ls --help
    Usage: ls [OPTION]... [FILE]...
    List information about the FILEs (the current directory by default).  #列出关于文件的信息
    Sort entries alphabetically if none of -cftuvSUX nor --sort.  #排序
    
    Mandatory arguments to long options are mandatory for short options too.
      -a, --all                  do not ignore entries starting with .  #列出所有信息
      -A, --almost-all           do not list implied . and ..  #不列出 .and..
          --author               with -l, print the author of each file  #配合-l,打印出其他的文件
      -b, --escape               print octal escapes for nongraphic characters
          --block-size=SIZE      use SIZE-byte blocks.  See SIZE format below
      -B, --ignore-backups       do not list implied entries ending with ~
      -c                         with -lt: sort by, and show, ctime (time of last
                                   modification of file status information)
                                   with -l: show ctime and sort by name
                                   otherwise: sort by ctime
      -C                         list entries by columns
          --color[=WHEN]         colorize the output.  WHEN defaults to `always'
                                   or can be `never' or `auto'.  More info below
      -d, --directory            list directory entries instead of contents,  #列出目录入口处,而不是内容而且不符号链接
                                   and do not dereference symbolic links
      -D, --dired                generate output designed for Emacs' dired mode
      -f                         do not sort, enable -aU, disable -ls --color  #不排序
      -F, --classify             append indicator (one of */=>@|) to entries
          --file-type            likewise, except do not append `*'
          --format=WORD          across -x, commas -m, horizontal -x, long -l,
                                   single-column -1, verbose -l, vertical -C
          --full-time            like -l --time-style=full-iso
      -g                         like -l, but do not list owner
          --group-directories-first
                                 group directories before files.
                                   augment with a --sort option, but any
                                   use of --sort=none (-U) disables grouping
      -G, --no-group             in a long listing, don't print group names
      -h, --human-readable       with -l, print sizes in human readable format
                                   (e.g., 1K 234M 2G)    #列出的信息以人们易读的形式
          --si                   likewise, but use powers of 1000 not 1024
      -H, --dereference-command-line
                                 follow symbolic links listed on the command line
          --dereference-command-line-symlink-to-dir
                                 follow each command line symbolic link
                                 that points to a directory
          --hide=PATTERN         do not list implied entries matching shell PATTERN
                                   (overridden by -a or -A)
          --indicator-style=WORD  append indicator with style WORD to entry names:
                                   none (default), slash (-p),
                                   file-type (--file-type), classify (-F)
      -i, --inode                print the index number of each file
      -I, --ignore=PATTERN       do not list implied entries matching shell PATTERN
      -k                         like --block-size=1K
      -l                         use a long listing format        #使用一个长列表形式
      -L, --dereference          when showing file information for a symbolic
                                   link, show information for the file the link
                                   references rather than for the link itself
      -m                         fill width with a comma separated list of entries
      -n, --numeric-uid-gid      like -l, but list numeric user and group IDs
      -N, --literal              print raw entry names (don't treat e.g. control
                                   characters specially)
      -o                         like -l, but do not list group information
      -p, --indicator-style=slash
                                 append / indicator to directories
      -q, --hide-control-chars   print ? instead of non graphic characters
          --show-control-chars   show non graphic characters as-is (default
                                 unless program is `ls' and output is a terminal)
      -Q, --quote-name           enclose entry names in double quotes
          --quoting-style=WORD   use quoting style WORD for entry names:
                                   literal, locale, shell, shell-always, c, escape
      -r, --reverse              reverse order while sorting  #反序当有排序时
      -R, --recursive            list subdirectories recursively
      -s, --size                 print the allocated size of each file, in blocks
      -S                         sort by file size
          --sort=WORD            sort by WORD instead of name: none -U,
                                 extension -X, size -S, time -t, version -v
          --time=WORD            with -l, show time as WORD instead of modification
                                 time: atime -u, access -u, use -u, ctime -c,
                                 or status -c; use specified time as sort key
                                 if --sort=time
          --time-style=STYLE     with -l, show times using style STYLE:
                                 full-iso, long-iso, iso, locale, +FORMAT.
                                 FORMAT is interpreted like `date'; if FORMAT is
                                 FORMAT1<newline>FORMAT2, FORMAT1 applies to
                                 non-recent files and FORMAT2 to recent files;
                                 if STYLE is prefixed with `posix-', STYLE
                                 takes effect only outside the POSIX locale
      -t                         sort by modification time    #按照修改时间排序
      -T, --tabsize=COLS         assume tab stops at each COLS instead of 8
      -u                         with -lt: sort by, and show, access time
                                   with -l: show access time and sort by name
                                   otherwise: sort by access time
      -U                         do not sort; list entries in directory order
      -v                         natural sort of (version) numbers within text
      -w, --width=COLS           assume screen width instead of current value
      -x                         list entries by lines instead of by columns
      -X                         sort alphabetically by entry extension
      -1                         list one file per line
    
    SELinux options:
    
      --lcontext                 Display security context.   Enable -l. Lines
                                 will probably be too wide for most displays.
      -Z, --context              Display security context so it fits on most
                                 displays.  Displays only mode, user, group,
                                 security context and file name.
      --scontext                 Display only security context and file name.
          --help     display this help and exit
          --version  output version information and exit
    
    SIZE may be (or may be an integer optionally followed by) one of following:
    KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.
    
    Using color to distinguish file types is disabled both by default and
    with --color=never.  With --color=auto, ls emits color codes only when
    standard output is connected to a terminal.  The LS_COLORS environment
    variable can change the settings.  Use the dircolors command to set it.
    
    Exit status:
     0  if OK,
     1  if minor problems (e.g., cannot access subdirectory),
     2  if serious trouble (e.g., cannot access command-line argument).
    
    Report ls bugs to bug-coreutils@gnu.org
    GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
    General help using GNU software: <http://www.gnu.org/gethelp/>
    For complete documentation, run: info coreutils 'ls invocation'

    3:  pwd

    pwd - print name of current/working directory  #打印当前或者工作目录的路径

    4:  touch

    [root@cairui etc]# touch --help
    Usage: touch [OPTION]... FILE...  #用法
    Update the access and modification times of each FILE to the current time.  #更新访问和修改时间到最新时间
    
    A FILE argument that does not exist is created empty, unless -c or -h
    is supplied.
    
    A FILE argument string of - is handled specially and causes touch to
    change the times of the file associated with standard output.
    
    Mandatory arguments to long options are mandatory for short options too.
      -a                     change only the access time  #仅修改访问时间
      -c, --no-create        do not create any files  #不创建任何文件
      -d, --date=STRING      parse STRING and use it instead of current time 
      -f                     (ignored)
      -h, --no-dereference   affect each symbolic link instead of any referenced
                             file (useful only on systems that can change the
                             timestamps of a symlink)
      -m                     change only the modification time
      -r, --reference=FILE   use this file's times instead of current time  #使用这个文件的时间而不是现在的时间,指定和某个文件时间相同
      -t STAMP               use [[CC]YY]MMDDhhmm[.ss] instead of current time  #指定时间
      --time=WORD            change the specified time:
                               WORD is access, atime, or use: equivalent to -a
                               WORD is modify or mtime: equivalent to -m
          --help     display this help and exit
          --version  output version information and exit
    
    Note that the -d and -t options accept different time-date formats.
    
    Report touch bugs to bug-coreutils@gnu.org
    GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
    General help using GNU software: <http://www.gnu.org/gethelp/>
    For complete documentation, run: info coreutils 'touch invocation'

    5:  mkdir

    [root@cairui tmp]# mkdir --help
    Usage: mkdir [OPTION]... DIRECTORY...  #用法
    Create the DIRECTORY(ies), if they do not already exist.  #创建目录,如果它们还没有存在。
    
    Mandatory arguments to long options are mandatory for short options too.
      -m, --mode=MODE   set file mode (as in chmod), not a=rwx - umask  #设置文件mode,类似于chmod
      -p, --parents     no error if existing, make parent directories as needed  #递归创建目录
      -v, --verbose     print a message for each created directory      #每创建一个目录就打印信息(显示创建的过程)
      -Z, --context=CTX  set the SELinux security context of each created
                          directory to CTX
          When COREUTILS_CHILD_DEFAULT_ACLS environment variable is set, -p/--parents
          option respects default umask and ACLs, as it does in Red Hat Enterprise Linux 7 by default
                --help     display this help and exit
          --version  output version information and exit
    
    Report mkdir bugs to bug-coreutils@gnu.org
    GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
    General help using GNU software: <http://www.gnu.org/gethelp/>
    For complete documentation, run: info coreutils 'mkdir invocation'

    6:  rm,rmdir(删除空目录)

    [root@cairui tmp]# rm --help
    Usage: rm [OPTION]... FILE...  #用法
    Remove (unlink) the FILE(s).  #删除文件
    
      -f, --force           ignore nonexistent files, never prompt  #不保护,强制删除
      -i                    prompt before every removal  
      -I                    prompt once before removing more than three files, or
                              when removing recursively.  Less intrusive than -i,
                              while still giving protection against most mistakes
          --interactive[=WHEN]  prompt according to WHEN: never, once (-I), or
                              always (-i).  Without WHEN, prompt always
          --one-file-system  when removing a hierarchy recursively, skip any
                              directory that is on a file system different from
                              that of the corresponding command line argument
          --no-preserve-root  do not treat `/' specially
          --preserve-root   do not remove `/' (default)
      -r, -R, --recursive   remove directories and their contents recursively  #递归删除目录和它的内容
      -v, --verbose         explain what is being done
          --help     display this help and exit
          --version  output version information and exit
    
    By default, rm does not remove directories.  Use the --recursive (-r or -R)
    option to remove each listed directory, too, along with all of its contents.
    
    To remove a file whose name starts with a `-', for example `-foo',
    use one of these commands:
      rm -- -foo
    
      rm ./-foo
    
    Note that if you use rm to remove a file, it is usually possible to recover
    the contents of that file.  If you want more assurance that the contents are
    truly unrecoverable, consider using shred.
    
    Report rm bugs to bug-coreutils@gnu.org
    GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
    General help using GNU software: <http://www.gnu.org/gethelp/>
    For complete documentation, run: info coreutils 'rm invocation'

    7:  who

    [root@localhost ~]# who --help
    用法:who [选项]... [ 文件 | 参数1 参数2 ]
    显示当前已登录的用户信息。
    
      -a, --all        等于-b -d --login -p -r -t -T -u 选项的组合
      -b, --boot        上次系统启动时间
      -d, --dead        显示已死的进程
      -H, --heading    输出头部的标题列
      -l,--login        显示系统登录进程
          --lookup        尝试通过 DNS 查验主机名
      -m            只面对和标准输入有直接交互的主机和用户
      -p, --process    显示由 init 进程衍生的活动进程
      -q, --count        列出所有已登录用户的登录名与用户数量
      -r, --runlevel    显示当前的运行级别
      -s, --short        只显示名称、线路和时间(默认)
      -T, -w, --mesg    用+,- 或 ? 标注用户消息状态
      -u, --users        列出已登录的用户
          --message    等于-T
          --writable    等于-T
          --help        显示此帮助信息并退出
          --version        显示版本信息并退出
    
    如果文件未被指定,则使用/var/run/utmp。/var/log/wtmp 是通用的相关文件。
    如果给定了参数1 和参数2,-m 会假定:"am i""mom likes"
    为参数。
    
    请向bug-coreutils@gnu.org 报告who 的错误
    GNU coreutils 项目主页:<http://www.gnu.org/software/coreutils/>
    GNU 软件一般性帮助:<http://www.gnu.org/gethelp/>
    请向<http://translationproject.org/team/zh_CN.html> 报告who 的翻译错误
    要获取完整文档,请运行:info coreutils 'who invocation'

    8:  w

    [root@localhost ~]# w --help
    w£ºÎÞЧѡÏî -- -
    usage: w -hlsufV [user]
        -h    skip header
        -l    long listing (default)
        -s    short listing
        -u    ignore uid of processes
        -f    toggle FROM field (default on)
        -i    display IP address instead of hostname (if possible)
        -V    display version

    9:  cp

    [root@localhost ~]# cp --help
    用法:cp [选项]... [-T] 源文件 目标文件
     或:cp [选项]... 源文件... 目录
     或:cp [选项]... -t 目录 源文件...
    将源文件复制至目标文件,或将多个源文件复制至目标目录。
    
    长选项必须使用的参数对于短选项时也是必需使用的。
      -a, --archive            等于-dR --preserve=all
          --backup[=CONTROL        为每个已存在的目标文件创建备份
      -b                类似--backup 但不接受参数
          --copy-contents        在递归处理是复制特殊文件内容
      -d                等于--no-dereference --preserve=links
      -f, --force            如果目标文件无法打开则将其移除并重试(当 -n 选项
                        存在时则不需再选此项)
      -i, --interactive        覆盖前询问(使前面的 -n 选项失效)
      -H                跟随源文件中的命令行符号链接
      -l, --link            链接文件而不复制
      -L, --dereference        总是跟随符号链接
      -n, --no-clobber        不要覆盖已存在的文件(使前面的 -i 选项失效)
      -P, --no-dereference        不跟随源文件中的符号链接
      -p                等于--preserve=模式,所有权,时间戳
          --preserve[=属性列表    保持指定的属性(默认:模式,所有权,时间戳),如果
                        可能保持附加属性:环境、链接、xattr 等
      -c                           same as --preserve=context
          --sno-preserve=属性列表    不保留指定的文件属性
          --parents            复制前在目标目录创建来源文件路径中的所有目录
      -R, -r, --recursive        递归复制目录及其子目录内的所有内容
          --reflink[=WHEN]        控制克隆/CoW 副本。请查看下面的内如。
          --remove-destination    尝试打开目标文件前先删除已存在的目的地
                        文件 (相对于 --force 选项)
          --sparse=WHEN        控制创建稀疏文件的方式
          --strip-trailing-slashes    删除参数中所有源文件/目录末端的斜杠
      -s, --symbolic-link        只创建符号链接而不复制文件
      -S, --suffix=后缀        自行指定备份文件的后缀
      -t,  --target-directory=目录    将所有参数指定的源文件/目录
                                               复制至目标目录
      -T, --no-target-directory    将目标目录视作普通文件
      -u, --update                 copy only when the SOURCE file is newer
                                     than the destination file or when the
                                     destination file is missing
      -v, --verbose                explain what is being done
      -x, --one-file-system        stay on this file system
      -Z, --context=CONTEXT        set security context of copy to CONTEXT
          --help        显示此帮助信息并退出
          --version        显示版本信息并退出
    
    默认情况下,源文件的稀疏性仅仅通过简单的方法判断,对应的目标文件目标文件也
    被为稀疏。这是因为默认情况下使用了--sparse=auto 参数。如果明确使用
    --sparse=always 参数则不论源文件是否包含足够长的0 序列也将目标文件创文
    建为稀疏件。
    使用--sparse=never 参数禁止创建稀疏文件。
    
    当指定了--reflink[=always] 参数时执行轻量化的复制,即只在数据块被修改的
    情况下才复制。如果复制失败或者同时指定了--reflink=auto,则返回标准复制模式。
    
    备份文件的后缀为"~",除非以--suffix 选项或是SIMPLE_BACKUP_SUFFIX
    环境变量指定。版本控制的方式可通过--backup 选项或VERSION_CONTROL 环境
    变量来选择。以下是可用的变量值:
    
      none, off       不进行备份(即使使用了--backup 选项)
      numbered, t     备份文件加上数字进行排序
      existing, nil   若有数字的备份文件已经存在则使用数字,否则使用普通方式备份
      simple, never   永远使用普通方式备份
    
    有一个特别情况:如果同时指定--force 和--backup 选项,而源文件和目标文件
    是同一个已存在的一般文件的话,cp 会将源文件备份。
    
    请向bug-coreutils@gnu.org 报告cp 的错误
    GNU coreutils 项目主页:<http://www.gnu.org/software/coreutils/>
    GNU 软件一般性帮助:<http://www.gnu.org/gethelp/>
    请向<http://translationproject.org/team/zh_CN.html> 报告cp 的翻译错误
    要获取完整文档,请运行:info coreutils 'cp invocation'

    10:  mv

    [root@localhost ~]# mv --help
    用法:mv [选项]... [-T] 源文件 目标文件
     或:mv [选项]... 源文件... 目录
     或:mv [选项]... -t 目录 源文件...
    将源文件重命名为目标文件,或将源文件移动至指定目录。
    
    长选项必须使用的参数对于短选项时也是必需使用的。
          --backup[=CONTROL]       为每个已存在的目标文件创建备份
      -b                           类似--backup 但不接受参数  #覆盖前备份
      -f, --force                  覆盖前不询问
      -i, --interactive            覆盖前询问
      -n, --no-clobber             不覆盖已存在文件
    如果您指定了-i、-f、-n 中的多个,仅最后一个生效。
          --strip-trailing-slashes    去掉每个源文件参数尾部的斜线
      -S, --suffix=SUFFIX        替换常用的备份文件后缀
      -t, --target-directory=DIRECTORY    将所有参数指定的源文件或目录  #将目录下所有内容移动到指定目录
                        移动至 指定目录
      -T, --no-target-directory    将目标文件视作普通文件处理
      -u, --update            只在源文件文件比目标文件新,或目标文件
                    不存在时才进行移动
      -v, --verbose        详细显示进行的步骤
          --help        显示此帮助信息并退出
          --version        显示版本信息并退出
    
    备份文件的后缀为"~",除非以--suffix 选项或是SIMPLE_BACKUP_SUFFIX
    环境变量指定。版本控制的方式可通过--backup 选项或VERSION_CONTROL 环境
    变量来选择。以下是可用的变量值:
    
      none, off       不进行备份(即使使用了--backup 选项)
      numbered, t     备份文件加上数字进行排序
      existing, nil   若有数字的备份文件已经存在则使用数字,否则使用普通方式备份
      simple, never   永远使用普通方式备份
    
    请向bug-coreutils@gnu.org 报告mv 的错误
    GNU coreutils 项目主页:<http://www.gnu.org/software/coreutils/>
    GNU 软件一般性帮助:<http://www.gnu.org/gethelp/>
    请向<http://translationproject.org/team/zh_CN.html> 报告mv 的翻译错误
    要获取完整文档,请运行:info coreutils 'mv invocation'

    11:  ifconfig

    [cairui@localhost ~]$ ifconfig --help
    Usage:
      ifconfig [-a] [-v] [-s] <interface> [[<AF>] <address>]
      [add <address>[/<prefixlen>]]
      [del <address>[/<prefixlen>]]
      [[-]broadcast [<address>]]  [[-]pointopoint [<address>]]
      [netmask <address>]  [dstaddr <address>]  [tunnel <address>]
      [outfill <NN>] [keepalive <NN>]
      [hw <HW> <address>]  [metric <NN>]  [mtu <NN>]
      [[-]trailers]  [[-]arp]  [[-]allmulti]
      [multicast]  [[-]promisc]
      [mem_start <NN>]  [io_addr <NN>]  [irq <NN>]  [media <type>]
      [txqueuelen <NN>]
      [[-]dynamic]
      [up|down] ...
    
      <HW>=Hardware Type.
      List of possible hardware types:
        loop (Local Loopback) slip (Serial Line IP) cslip (VJ Serial Line IP) 
        slip6 (6-bit Serial Line IP) cslip6 (VJ 6-bit Serial Line IP) adaptive (Adaptive Serial Line IP) 
        strip (Metricom Starmode IP) ash (Ash) ether (Ethernet) 
        tr (16/4 Mbps Token Ring) tr (16/4 Mbps Token Ring (New)) ax25 (AMPR AX.25) 
        netrom (AMPR NET/ROM) rose (AMPR ROSE) tunnel (IPIP Tunnel) 
        ppp (Point-to-Point Protocol) hdlc ((Cisco)-HDLC) lapb (LAPB) 
        arcnet (ARCnet) dlci (Frame Relay DLCI) frad (Frame Relay Access Device) 
        sit (IPv6-in-IPv4) fddi (Fiber Distributed Data Interface) hippi (HIPPI) 
        irda (IrLAP) ec (Econet) x25 (generic X.25) 
        infiniband (InfiniBand) 
      <AF>=Address family. Default: inet
      List of possible address families:
        unix (UNIX Domain) inet (DARPA Internet) inet6 (IPv6) 
        ax25 (AMPR AX.25) netrom (AMPR NET/ROM) rose (AMPR ROSE) 
        ipx (Novell IPX) ddp (Appletalk DDP) ec (Econet) 
        ash (Ash) x25 (CCITT X.25) 

    12:  tar

    [root@localhost ~]# tar --help
    用法: tar [选项...] [FILE]...
     GNU ‘tar将许多文件一起保存至一个单独的磁带或磁盘归档,并能从归档中单独还原所需文件。
    
    示例
      tar -cf archive.tar foo bar  # 从文件 foo 和 bar 创建归档文件
    archive.tartar -tvf archive.tar         # 详细列举归档文件 archive.tar
    中的所有文件。
      tar -xf archive.tar          # 展开归档文件 archive.tar
    中的所有文件。
    
     主操作模式:
    
      -A, --catenate, --concatenate   追加 tar 文件至归档
      -c, --create               创建一个新归档
      -d, --diff, --compare      找出归档和文件系统的差异
          --delete               从归档(非磁带!)中删除
      -r, --append               追加文件至归档结尾
      -t, --list                 列出归档内容
          --test-label           测试归档卷标并退出
      -u, --update               仅追加比归档中副本更新的文件
      -x, --extract, --get       从归档中解出文件  #解压缩
    
     操作修饰符:
    
          --check-device         当创建增量归档时检查设备号(默认)
      -g, --listed-incremental=FILE   处理新式的 GNU 格式的增量备份
      -G, --incremental          处理老式的 GNU 格式的增量备份
          --ignore-failed-read
                                 当遇上不可读文件时不要以非零值退出
          --level=NUMBER         所创建的增量列表归档的输出级别
      -n, --seek                 归档可检索
          --no-check-device      当创建增量归档时不要检查设备号
          --no-seek              归档不可检索
          --occurrence[=NUMBER]  仅处理归档中每个文件的第 NUMBER
                                 个事件;仅当与以下子命令 --delete,
                                 --diff, --extract 或是 --list
                                 中的一个联合使用时,此选项才有效。而且不管文件列表是以命令行形式给出或是通过
                                 -T 选项指定的;NUMBER 值默认为 1
          --sparse-version=MAJOR[.MINOR]
                                 设置所用的离散格式版本(隐含
                                 --sparse)
      -S, --sparse               高效处理离散文件
    
     重写控制:
    
      -k, --keep-old-files       don't replace existing files when extracting,
                                 treat them as errors
          --keep-newer-files
                                 不要替换比归档中副本更新的已存在的文件
          --no-overwrite-dir     保留已存在目录的元数据
          --overwrite            解压时重写存在的文件
          --overwrite-dir
                                 解压时重写已存在目录的元数据(默认)
                                
          --recursive-unlink     解压目录之前先清除目录层次
          --remove-files         在添加文件至归档后删除它们
          --skip-old-files       don't replace existing files when extracting,
                                 silently skip over them
      -U, --unlink-first         在解压要重写的文件之前先删除它们
      -W, --verify               在写入以后尝试校验归档
    
     选择输出流:
    
          --ignore-command-error 忽略子进程的退出代码
          --no-ignore-command-error
                                 将子进程的非零退出代码认为发生错误
      -O, --to-stdout            解压文件至标准输出
          --to-command=COMMAND
                                 将解压的文件通过管道传送至另一个程序
    
     操作文件属性:
    
          --acls                 Save the ACLs to the archive
          --atime-preserve[=METHOD]
                                 在输出的文件上保留访问时间,要么通过在读取(默认
                                 METHOD=‘replace’)后还原时间,要不就不要在第一次(METHOD=‘system’)设置时间
          --delay-directory-restore
                                 直到解压结束才设置修改时间和所解目录的权限
          --group=名称         强制将 NAME
                                 作为所添加的文件的组所有者
          --mode=CHANGES         强制将所添加的文件(符号)更改为权限
                                 CHANGES
          --mtime=DATE-OR-FILE   从 DATE-OR-FILE 中为添加的文件设置 mtime
                                
      -m, --touch                不要解压文件的修改时间
          --no-acls              Don't extract the ACLs from the archive
          --no-delay-directory-restore
                                 取消 --delay-directory-restore 选项的效果
          --no-same-owner
                                 将文件解压为您所有(普通用户默认此项)
          --no-same-permissions
                                 从归档中解压权限时使用用户的掩码位(默认为普通用户服务)
          --no-selinux           Don't extract the SELinux context from the
                                 archive
          --no-xattrs            Don't extract the user/root xattrs from the
                                 archive
          --numeric-owner        总是以数字代表用户/组的名称
          --owner=名称         强制将 NAME
                                 作为所添加的文件的所有者
      -p, --preserve-permissions, --same-permissions
                                 解压文件权限信息(默认只为超级用户服务)
          --preserve             与 -p 和 -s 一样
          --same-owner
                                 尝试解压时保持所有者关系一致(超级用户默认此项)
      -s, --preserve-order, --same-order
                                 为解压至匹配归档排序名称
          --selinux              Save the SELinux context to the archive
          --xattrs               Save the user/root xattrs to the archive
    
     设备选择和切换:
    
      -f, --file=ARCHIVE         使用归档文件或 ARCHIVE 设备
          --force-local
                                 即使归档文件存在副本还是把它认为是本地归档
      -F, --info-script=名称, --new-volume-script=名称
                                 在每卷磁带最后运行脚本(隐含 -M)
      -L, --tape-length=NUMBER   写入 NUMBER × 1024 字节后更换磁带
      -M, --multi-volume         创建/列出/解压多卷归档文件
          --rmt-command=COMMAND  使用指定的 rmt COMMAND 代替 rmt
          --rsh-command=COMMAND  使用远程 COMMAND 代替 rsh
          --volno-file=FILE      使用/更新 FILE 中的卷数
    
     设备分块:
    
      -b, --blocking-factor=BLOCKS   每个记录 BLOCKS x 512 字节
      -B, --read-full-records    读取时重新分块(只对 4.2BSD 管道有效)
      -i, --ignore-zeros         忽略归档中的零字节块(即文件结尾)
          --record-size=NUMBER   每个记录的字节数 NUMBER,乘以 512
    
     选择归档格式:
    
      -H, --format=FORMAT        创建指定格式的归档
    
     FORMAT 是以下格式中的一种:
    
        gnu                      GNU tar 1.13.x 格式
        oldgnu                   GNU 格式 as per tar <= 1.12
        pax                      POSIX 1003.1-2001 (pax) 格式
        posix                    等同于 pax
        ustar                    POSIX 1003.1-1988 (ustar) 格式
        v7                       old V7 tar 格式
    
          --old-archive, --portability
                                 等同于 --format=v7
          --pax-option=关键字[[:]=值][,关键字[[:]=值]]...
                                 控制 pax 关键字
          --posix                等同于 --format=posix
      -V, --label=TEXT           创建带有卷名 TEXT
                                 的归档;在列出/解压时,使用 TEXT
                                 作为卷名的模式串
    
     压缩选项:
    
      -a, --auto-compress        使用归档后缀名来决定压缩程序
      -I, --use-compress-program=PROG
                                 通过 PROG 过滤(必须是能接受 -d
                                 选项的程序)
      -j, --bzip2                通过 bzip2 过滤归档
      -J, --xz                   通过 xz 过滤归档
          --lzip                 通过 lzip 过滤归档
          --lzma                 通过 lzma 过滤归档
          --lzop
          --no-auto-compress     不使用归档后缀名来决定压缩程序
      -z, --gzip, --gunzip, --ungzip   通过 gzip 过滤归档
      -Z, --compress, --uncompress   通过 compress 过滤归档
    
     本地文件选择:
    
          --add-file=FILE        添加指定的 FILE 至归档(如果名字以 -
                                 开始会很有用的)
          --backup[=CONTROL]     在删除前备份,选择 CONTROL 版本
      -C, --directory=DIR        改变至目录 DIR
          --exclude=PATTERN      排除以 PATTERN 指定的文件
          --exclude-backups      排除备份和锁文件
          --exclude-caches       除标识文件本身外,排除包含
                                 CACHEDIR.TAG 的目录中的内容
          --exclude-caches-all   排除包含 CACHEDIR.TAG 的目录
          --exclude-caches-under 排除包含 CACHEDIR.TAG 的目录中所有内容
                                
          --exclude-tag=FILE     除 FILE 自身外,排除包含 FILE
                                 的目录中的内容
          --exclude-tag-all=FILE 排除包含 FILE 的目录
          --exclude-tag-under=FILE   排除包含 FILE 的目录中的所有内容
          --exclude-vcs          排除版本控制系统目录
      -h, --dereference
                                 跟踪符号链接;将它们所指向的文件归档并输出
          --hard-dereference
                                 跟踪硬链接;将它们所指向的文件归档并输出
      -K, --starting-file=MEMBER-NAME
                                 从归档中的 MEMBER-NAME 成员处开始
          --newer-mtime=DATE     当只有数据改变时比较数据和时间
          --no-null              禁用上一次的效果 --null 选项
          --no-recursion         避免目录中的自动降级
          --no-unquote           不以 -T 读取的文件名作为引用结束
          --null                 -T 读取以空终止的名字,-C 禁用
      -N, --newer=DATE-OR-FILE, --after-date=DATE-OR-FILE
                                 只保存比 DATE-OR-FILE 更新的文件
          --one-file-system      创建归档时保存在本地文件系统中
      -P, --absolute-names       不要从文件名中清除引导符‘/--recursion            目录递归(默认)
          --suffix=STRING        在删除前备份,除非被环境变量
                                 SIMPLE_BACKUP_SUFFIX
                                 覆盖,否则覆盖常用后缀(‘’)
      -T, --files-from=FILE      从 FILE
                                 中获取文件名来解压或创建文件
          --unquote              以 -T
                                 读取的文件名作为引用结束(默认)
      -X, --exclude-from=FILE    排除 FILE 中列出的模式串
    
     文件名变换:
    
          --strip-components=NUMBER   解压时从文件名中清除 NUMBER
                                 个引导部分
          --transform=EXPRESSION, --xform=EXPRESSION
                                 使用 sed 代替 EXPRESSION
                                 来进行文件名变换
    
     文件名匹配选项(同时影响排除和包括模式串):
    
          --anchored             模式串匹配文件名头部
          --ignore-case          忽略大小写
          --no-anchored          模式串匹配任意‘/’后字符(默认对
                                 exclusion 有效)
          --no-ignore-case       匹配大小写(默认)
          --no-wildcards         逐字匹配字符串
          --no-wildcards-match-slash   通配符不匹配‘/--wildcards            use wildcards (default)
          --wildcards-match-slash
                                 通配符匹配‘/’(默认对排除操作有效)
    
     提示性输出:
    
          --checkpoint[=NUMBER]  每隔 NUMBER
                                 个记录显示进度信息(默认为 10 个)
          --checkpoint-action=ACTION   在每个检查点上执行 ACTION
          --index-file=FILE      将详细输出发送至 FILE
      -l, --check-links
                                 只要不是所有链接都被输出就打印信息
          --no-quote-chars=STRING   禁用来自 STRING 的字符引用
          --quote-chars=STRING   来自 STRING 的额外的引用字符
          --quoting-style=STYLE  设置名称引用风格;有效的 STYLE
                                 值请参阅以下说明
      -R, --block-number         每个信息都显示归档内的块数
          --show-defaults        显示 tar 默认选项
          --show-omitted-dirs
                                 列表或解压时,列出每个不匹配查找标准的目录
          --show-transformed-names, --show-stored-names
                                 显示变换后的文件名或归档名
          --totals[=SIGNAL]      处理归档后打印出总字节数;当此
                                 SIGNAL 被触发时带参数 -
                                 打印总字节数;允许的信号为:
                                 SIGHUP,SIGQUIT,SIGINT,SIGUSR1 和
                                 SIGUSR2;同时也接受不带 SIG
                                 前缀的信号名称
          --utc                  以 UTC 格式打印文件修改信息
      -v, --verbose              详细地列出处理的文件
          --warning=KEYWORD      警告控制:
      -w, --interactive, --confirmation
                                 每次操作都要求确认
    
     兼容性选项:
    
      -o                         创建归档时,相当于
                                 --old-archive;展开归档时,相当于
                                 --no-same-owner
    
     其它选项:
    
      -?, --help                 显示此帮助列表
          --restrict             禁用某些潜在的有危险的选项
          --usage                显示简短的用法说明
          --version              打印程序版本
    
    长选项和相应短选项具有相同的强制参数或可选参数。
    
    除非以 --suffix 或 SIMPLE_BACKUP_SUFFIX
    设置备份后缀,否则备份后缀就是“~”。
    可以用 --backup 或 VERSION_CONTROL 设置版本控制,可能的值为:
    
      none, off       从不做备份
      t, numbered     进行编号备份
      nil, existing
    如果编号备份存在则进行编号备份,否则进行简单备份
      never, simple   总是使用简单备份
    
    --quoting-style 选项的有效参数为:
    
      literal
      shell
      shell-always
      c
      c-maybe
      escape
      locale
      clocale
    
    此 tar 默认为:
    --format=gnu -f- -b20 --quoting-style=escape --rmt-command=/sbin/rmt
    --rsh-command=/usr/bin/rsh
    
    将错误报告发送到 <bug-tar@gnu.org>。

    13:  date

    [root@localhost ~]# date --help
    用法:date [选项]... [+格式]
     或:date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
    以给定的格式显示当前时间,或是设置系统日期。
    
      -d,--date=字符串        显示指定字符串所描述的时间,而非当前时间
      -f,--file=日期文件        类似--date,从日期文件中按行读入时间描述
      -r, --reference=文件        显示文件指定文件的最后修改时间
      -R, --rfc-2822        以RFC 2822格式输出日期和时间
                    例如:2006年8月7日,星期一 12:34:56 -0600
          --rfc-3339=TIMESPEC    以RFC 3339 格式输出日期和时间。
                    TIMESPEC=`date',`seconds',或 `ns' 
                    表示日期和时间的显示精度。
                    日期和时间单元由单个的空格分开:
                    2006-08-07 12:34:56-06:00
      -s, --set=字符串             设置指定字符串来分开时间
      -u, --utc, --universal    输出或者设置协调的通用时间
          --help        显示此帮助信息并退出
          --version        显示版本信息并退出
    
    给定的格式FORMAT 控制着输出,解释序列如下:
    
      %%    一个文字的 %
      %a    当前locale 的星期名缩写(例如: 日,代表星期日)
      %A    当前locale 的星期名全称 (如:星期日)
      %b    当前locale 的月名缩写 (如:一,代表一月)
      %B    当前locale 的月名全称 (如:一月)
      %c    当前locale 的日期和时间 (如:2005年3月3日 星期四 23:05:25)
      %C    世纪;比如 %Y,通常为省略当前年份的后两位数字(例如:20)
      %d    按月计的日期(例如:01)
      %D    按月计的日期;等于%m/%d/%y
      %e    按月计的日期,添加空格,等于%_d
      %F    完整日期格式,等价于 %Y-%m-%d
      %g    ISO-8601 格式年份的最后两位 (参见%G)
      %G    ISO-8601 格式年份 (参见%V),一般只和 %V 结合使用
      %h    等于%b
      %H    小时(00-23)
      %I    小时(00-12)
      %j    按年计的日期(001-366)
      %k    时(0-23)
      %l    时(1-12)
      %m    月份(01-12)
      %M    分(00-59)
      %n    换行
      %N    纳秒(000000000-999999999)
      %p    当前locale 下的"上午"或者"下午",未知时输出为空
      %P    与%p 类似,但是输出小写字母
      %r    当前locale 下的 12 小时时钟时间 (如:11:11:04 下午)
      %R    24 小时时间的时和分,等价于 %H:%M
      %s    自UTC 时间 1970-01-01 00:00:00 以来所经过的秒数
      %S    秒(00-60)
      %t    输出制表符 Tab
      %T    时间,等于%H:%M:%S
      %u    星期,1 代表星期一
      %U    一年中的第几周,以周日为每星期第一天(00-53)
      %V    ISO-8601 格式规范下的一年中第几周,以周一为每星期第一天(01-53)
      %w    一星期中的第几日(0-6),0 代表周一
      %W    一年中的第几周,以周一为每星期第一天(00-53)
      %x    当前locale 下的日期描述 (如:12/31/99)
      %X    当前locale 下的时间描述 (如:23:13:48)
      %y    年份最后两位数位 (00-99)
      %Y    年份
      %z +hhmm        数字时区(例如,-0400)
      %:z +hh:mm        数字时区(例如,-04:00)
      %::z +hh:mm:ss    数字时区(例如,-04:00:00)
      %:::z            数字时区带有必要的精度 (例如,-04,+05:30)
      %Z            按字母表排序的时区缩写 (例如,EDT)
    
    默认情况下,日期的数字区域以0 填充。
    以下可选标记可以跟在"%"后:
    
      - (连字符)不填充该域
      _ (下划线)以空格填充
      0 (数字0)以0 填充
      ^ 如果可能,使用大写字母
      # 如果可能,使用相反的大小写
    
    在任何标记之后还允许一个可选的域宽度指定,它是一个十进制数字。
    作为一个可选的修饰声明,它可以是E,在可能的情况下使用本地环境关联的
    表示方式;或者是O,在可能的情况下使用本地环境关联的数字符号。
    
    请向bug-coreutils@gnu.org 报告date 的错误
    GNU coreutils 项目主页:<http://www.gnu.org/software/coreutils/>
    GNU 软件一般性帮助:<http://www.gnu.org/gethelp/>
    请向<http://translationproject.org/team/zh_CN.html> 报告date 的翻译错误
    要获取完整文档,请运行:info coreutils 'date invocation'

    14:  cat

    [root@localhost ~]# cat --help
    用法:cat [选项]... [文件]...
    将[文件]或标准输入组合输出到标准输出。
    
      -A, --show-all           等于-vET
      -b, --number-nonblank    对非空输出行编号
      -e                       等于-vE
      -E, --show-ends          在每行结束处显示"$"
      -n, --number             对输出的所有行编号
      -s, --squeeze-blank      不输出多行空行
      -t                       与-vT 等价
      -T, --show-tabs          将跳格字符显示为^I
      -u                       (被忽略)
      -v, --show-nonprinting   使用^ 和M- 引用,除了LFD和 TAB 之外
          --help        显示此帮助信息并退出
          --version        显示版本信息并退出
    
    如果没有指定文件,或者文件为"-",则从标准输入读取。
    
    示例:
      cat f - g  先输出f 的内容,然后输出标准输入的内容,最后输出g 的内容。
      cat        将标准输入的内容复制到标准输出。
    
    请向bug-coreutils@gnu.org 报告cat 的错误
    GNU coreutils 项目主页:<http://www.gnu.org/software/coreutils/>
    GNU 软件一般性帮助:<http://www.gnu.org/gethelp/>
    请向<http://translationproject.org/team/zh_CN.html> 报告cat 的翻译错误
    要获取完整文档,请运行:info coreutils 'cat invocation'

    将文件内容直接写入另一个文件(可以不存在)此功能 与 echo 类似

    文件合并功能

    15.  chmod

    [root@cairui ~]# chmod --help
    Usage: chmod [OPTION]... MODE[,MODE]... FILE...
      or:  chmod [OPTION]... OCTAL-MODE FILE...
      or:  chmod [OPTION]... --reference=RFILE FILE...
    Change the mode of each FILE to MODE.
    
      -c, --changes           like verbose but report only when a change is made
          --no-preserve-root  do not treat `/' specially (the default)
          --preserve-root     fail to operate recursively on `/'
      -f, --silent, --quiet   suppress most error messages
      -v, --verbose           output a diagnostic for every file processed
          --reference=RFILE   use RFILE's mode instead of MODE values
      -R, --recursive         change files and directories recursively   #递归修改文件及目录 
          --help     display this help and exit
          --version  output version information and exit
    
    Each MODE is of the form `[ugoa]*([-+=]([rwxXst]*|[ugo]))+'.
    
    Report chmod bugs to bug-coreutils@gnu.org
    GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
    General help using GNU software: <http://www.gnu.org/gethelp/>
    For complete documentation, run: info coreutils 'chmod invocation'

    16、  chown

    [root@cairui tmp]# chown --help
    Usage: chown [OPTION]... [OWNER][:[GROUP]] FILE...
      or:  chown [OPTION]... --reference=RFILE FILE...
    Change the owner and/or group of each FILE to OWNER and/or GROUP.  #改变s或所属者者所属组
    With --reference, change the owner and group of each FILE to those of RFILE.
    
      -c, --changes          like verbose but report only when a change is made
          --dereference      affect the referent of each symbolic link (this is
                             the default), rather than the symbolic link itself
      -h, --no-dereference   affect each symbolic link instead of any referenced
                             file (useful only on systems that can change the
                             ownership of a symlink)
          --from=CURRENT_OWNER:CURRENT_GROUP
                             change the owner and/or group of each file only if
                             its current owner and/or group match those specified
                             here.  Either may be omitted, in which case a match
                             is not required for the omitted attribute.
          --no-preserve-root  do not treat `/' specially (the default)
          --preserve-root    fail to operate recursively on `/'
      -f, --silent, --quiet  suppress most error messages
          --reference=RFILE  use RFILE's owner and group rather than
                             specifying OWNER:GROUP values
      -R, --recursive        operate on files and directories recursively  #递归改变文件和目录
      -v, --verbose          output a diagnostic for every file processed
    
    The following options modify how a hierarchy is traversed when the -R
    option is also specified.  If more than one is specified, only the final
    one takes effect.
    
      -H                     if a command line argument is a symbolic link
                             to a directory, traverse it
      -L                     traverse every symbolic link to a directory
                             encountered
      -P                     do not traverse any symbolic links (default)
    
          --help     display this help and exit
          --version  output version information and exit
    
    Owner is unchanged if missing.  Group is unchanged if missing, but changed
    to login group if implied by a `:' following a symbolic OWNER.
    OWNER and GROUP may be numeric as well as symbolic.
    
    Examples:
      chown root /u        Change the owner of /u to "root".
      chown root:staff /u  Likewise, but also change its group to "staff".  #所属者:所属组
      chown -hR root /u    Change the owner of /u and subfiles to "root".
    
    Report chown bugs to bug-coreutils@gnu.org
    GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
    General help using GNU software: <http://www.gnu.org/gethelp/>
    For complete documentation, run: info coreutils 'chown invocation'

    17、  umask(修改默认权限)

    umask [-p] [-S] [mode]
                  The  user  file-creation  mask  is  set  to mode.  If mode
                  begins with a digit, it is interpreted as an octal number;
                  otherwise  it is interpreted as a symbolic mode mask simi-
                  lar to that accepted by chmod(1).  If mode is omitted, the
                  current  value  of  the  mask  is  printed.  The -S option
                  causes the mask  to  be  printed  in  symbolic  form;  the
                  default  output  is  an octal number.  If the -p option is
                  supplied, and mode is omitted, the output  is  in  a  form
                  that  may  be  reused as input.  The return status is 0 if
                  the mode was successfully changed or if no  mode  argument
                  was supplied, and false otherwise.

    默认情况下,目录权限是755,文件权限是644

    18、  chattr

    chattr +i(-i)  文件名  锁定文件(取消锁定)不可删除与清空

    chattr +a(-a)  文件名  添加内容(只可添加内容)

    lsattr  文件名  查看文件特殊属性

    19、  grep

    [root@cairui ~]# grep --help
    Usage: grep [OPTION]... PATTERN [FILE]...
    Search for PATTERN in each FILE or standard input.  #搜索正则匹配在每个文件中或标准输出中。
    PATTERN is, by default, a basic regular expression (BRE).
    Example: grep -i 'hello world' menu.h main.c
    
    Regexp selection and interpretation:
      -E, --extended-regexp     PATTERN is an extended regular expression (ERE)  
      -F, --fixed-strings       PATTERN is a set of newline-separated fixed strings
      -G, --basic-regexp        PATTERN is a basic regular expression (BRE)
      -P, --perl-regexp         PATTERN is a Perl regular expression
      -e, --regexp=PATTERN      use PATTERN for matching
      -f, --file=FILE           obtain PATTERN from FILE
      -i, --ignore-case         ignore case distinctions
      -w, --word-regexp         force PATTERN to match only whole words
      -x, --line-regexp         force PATTERN to match only whole lines
      -z, --null-data           a data line ends in 0 byte, not newline
    
    Miscellaneous:
      -s, --no-messages         suppress error messages  #不显示不存在或无匹配文本的错误信息
      -v, --invert-match        select non-matching lines  #显示不包含匹配文本的所有行
      -V, --version             display version information and exit
          --help                display this help text and exit
    
    Output control:
      -m, --max-count=NUM       stop after NUM matches
      -b, --byte-offset         print the byte offset with output lines
      -n, --line-number         print line number with output lines  #显示行行和输出行
          --line-buffered       flush output on every line
      -H, --with-filename       print the file name for each match
      -h, --no-filename         suppress the file name prefix on output
          --label=LABEL         use LABEL as the standard input file name prefix
      -o, --only-matching       show only the part of a line matching PATTERN
      -q, --quiet, --silent     suppress all normal output
          --binary-files=TYPE   assume that binary files are TYPE;
                                TYPE is 'binary', 'text', or 'without-match'
      -a, --text                equivalent to --binary-files=text
      -I                        equivalent to --binary-files=without-match
      -d, --directories=ACTION  how to handle directories;
                                ACTION is 'read', 'recurse', or 'skip'
      -D, --devices=ACTION      how to handle devices, FIFOs and sockets;
                                ACTION is 'read' or 'skip'
      -r, --recursive           like --directories=recurse
      -R, --dereference-recursive
                                likewise, but follow all symlinks
          --include=FILE_PATTERN
                                search only files that match FILE_PATTERN
          --exclude=FILE_PATTERN
                                skip files and directories matching FILE_PATTERN
          --exclude-from=FILE   skip files matching any file pattern from FILE
          --exclude-dir=PATTERN directories that match PATTERN will be skipped.
      -L, --files-without-match print only names of FILEs containing no match
      -l, --files-with-matches  print only names of FILEs containing matches  #不区分大小写
      -c, --count               print only a count of matching lines per FILE  #只输出匹配行的计数
      -T, --initial-tab         make tabs line up (if needed)
      -Z, --null                print 0 byte after FILE name
    
    Context control:
      -B, --before-context=NUM  print NUM lines of leading context
      -A, --after-context=NUM   print NUM lines of trailing context
      -C, --context=NUM         print NUM lines of output context
      -NUM                      same as --context=NUM
          --group-separator=SEP use SEP as a group separator
          --no-group-separator  use empty string as a group separator
          --color[=WHEN],
          --colour[=WHEN]       use markers to highlight the matching strings;
                                WHEN is 'always', 'never', or 'auto'
      -U, --binary              do not strip CR characters at EOL (MSDOS/Windows)
      -u, --unix-byte-offsets   report offsets as if CRs were not there
                                (MSDOS/Windows)
    
    'egrep' means 'grep -E'.  'fgrep' means 'grep -F'.  #important
    Direct invocation as either 'egrep' or 'fgrep' is deprecated.
    When FILE is -, read standard input.  With no FILE, read . if a command-line
    -r is given, - otherwise.  If fewer than two FILEs are given, assume -h.
    Exit status is 0 if any line is selected, 1 otherwise;
    if any error occurs and -q is not given, the exit status is 2.
    
    Report bugs to: bug-grep@gnu.org
    GNU Grep home page: <http://www.gnu.org/software/grep/>
    General help using GNU software: <http://www.gnu.org/gethelp/>

    20、  sed

    [root@cairui ~]# sed --help
    Usage: sed [OPTION]... {script-only-if-no-other-script} [input-file]...
    
      -n, --quiet, --silent
                     suppress automatic printing of pattern space  #取消默认输出
      -e script, --expression=script
                     add the script to the commands to be executed
      -f script-file, --file=script-file
                     add the contents of script-file to the commands to be executed
      --follow-symlinks
                     follow symlinks when processing in place; hard links
                     will still be broken.
      -i[SUFFIX], --in-place[=SUFFIX]
                     edit files in place (makes backup if extension supplied).
                     The default operation mode is to break symbolic and hard links.
                     This can be changed with --follow-symlinks and --copy.  #修改文件内容
      -c, --copy
                     use copy instead of rename when shuffling files in -i mode.
                     While this will avoid breaking links (symbolic or hard), the
                     resulting editing operation is not atomic.  This is rarely
                     the desired mode; --follow-symlinks is usually enough, and
                     it is both faster and more secure.
      -l N, --line-length=N
                     specify the desired line-wrap length for the `l' command
      --posix
                     disable all GNU extensions.
      -r, --regexp-extended
                     use extended regular expressions in the script.  #在脚本中使用扩展正则表达式
      -s, --separate
                     consider files as separate rather than as a single continuous
                     long stream.
      -u, --unbuffered
                     load minimal amounts of data from the input files and flush
                     the output buffers more often
          --help     display this help and exit
          --version  output version information and exit
    
    If no -e, --expression, -f, or --file option is given, then the first
    non-option argument is taken as the sed script to interpret.  All
    remaining arguments are names of input files; if no input files are
    specified, then the standard input is read.
    
    GNU sed home page: <http://www.gnu.org/software/sed/>.
    General help using GNU software: <http://www.gnu.org/gethelp/>.
    E-mail bug reports to: <bug-gnu-utils@gnu.org>.
    Be sure to include the word ``sed'' somewhere in the ``Subject:'' field.

    21、  awk

    [root@cairui ~]# awk --help
    Usage: awk [POSIX or GNU style options] -f progfile [--] file ...
    Usage: awk [POSIX or GNU style options] [--] 'program' file ...
    POSIX options:        GNU long options:
        -f progfile        --file=progfile
        -F fs            --field-separator=fs
        -v var=val        --assign=var=val
        -m[fr] val
        -O            --optimize
        -W compat        --compat
        -W copyleft        --copyleft
        -W copyright        --copyright
        -W dump-variables[=file]    --dump-variables[=file]
        -W exec=file        --exec=file
        -W gen-po        --gen-po
        -W help            --help
        -W lint[=fatal]        --lint[=fatal]
        -W lint-old        --lint-old
        -W non-decimal-data    --non-decimal-data
        -W profile[=file]    --profile[=file]
        -W posix        --posix
        -W re-interval        --re-interval
        -W source=program-text    --source=program-text
        -W traditional        --traditional
        -W usage        --usage
        -W use-lc-numeric    --use-lc-numeric
        -W version        --version
    
    To report bugs, see node `Bugs' in `gawk.info', which is
    section `Reporting Problems and Bugs' in the printed version.
    
    gawk is a pattern scanning and processing language.
    By default it reads standard input and writes standard output.
    
    Examples:
        gawk '{ sum += $1 }; END { print sum }' file
        gawk -F: '{ print $1 }' /etc/passwd
  • 相关阅读:
    《那些年,我们拿下FPGA》做笔记
    三种初始化
    hdu4417 Super Mario 树阵离线/划分树
    【设计模式】文章摘要 查找联系人控件
    STL set
    阐述 QUEST CENTRAL FOR DB2 八罪
    使用线程执行堆栈StackTraceElement设计Android日志模块
    苹果iOS苹果公司的手机用户都有权索赔
    Android 4.4 沉浸式透明状态栏与导航栏
    常见的几种RuntimeException
  • 原文地址:https://www.cnblogs.com/caicairui/p/8352115.html
Copyright © 2011-2022 走看看