每天一个Linux命令—— WC

一、首先看一下帮助

  Usage: wc [OPTION]... [FILE]...
    or:  wc [OPTION]... --files0-from=F
  Print newline, word, and byte counts for each FILE, and a total line if
  more than one FILE is specified.  With no FILE, or when FILE is -,
  read standard input.
    -c, --bytes            print the byte counts
    -m, --chars            print the character counts
    -l, --lines            print the newline counts
        --files0-from=F    read input from the files specified by
                           NUL-terminated names in file F;
                           If F is - then read names from standard input
    -L, --max-line-length  print the length of the longest line
    -w, --words            print the word counts
        --help     display this help and exit
        --version  output version information and exit

二、根据帮助得知wc命令使用方法

  用法:wc [选项]...[文件]...

  或者是:wc [选项]... --files0-from=F

  打印文件中的行数,单词数以及字节数,如果指定多个文件,则可以统计所有文件的行数。如果没有文件或者文件是-,则读取标准输入

  参数释义:  

      -c   --bytes  统计并打印字节数

      -m  --chars  统计并打印字符数

      -l    --lines   统计宾打印行数

          --files0-from=F  从指定的以NUL-结尾的文件F中读取输入,如果F是- 则从标准输入中读取名字

       -L,   --max-line-length    打印长度最长的行内容

       -w,   --words               打印文件中单词数

               --help            打印帮助信息并退出

               --version           打印版本信息并退出

原文地址:https://www.cnblogs.com/MrFee/p/4682988.html