| wc命令统计指定文件中的字节数、字数、行数,并将统计结果显示输出。利用wc指令我们可以计算文件的Byte数、字数或是列数,若不指定文件名称,或是所给予的文件名为“-”,则wc指令会从标准输入设备读取数据。wc同时也给出所指定文件的总统计数。  语法格式:wc [参数] [文件]  常用参数:? | -w | 统计字数,或--words:只显示字数。一个字被定义为由空白、跳格或换行字符分隔的字符串 |  | -c | 统计字节数,或--bytes或--chars:只显示Bytes数 |  | -l | 统计行数,或--lines:只显示列数 |  | -m | 统计字符数 |  | -L | 打印最长行的长度 |  | --help | 显示帮助信息 |  | --version | 显示版本信息 | 
参考实例 统计字数: [root@linuxcool ~]# cat test.txt hello world
 hello world
 hello world
 hello world hello world
 [root@linuxcool ~]# wc -w test.txt
 10 test.txt
 统计字节数: [root@linuxcool ~]# wc -c test.txt 60 test.txt
 统计字符数: [root@linuxcool ~]# wc -m test.txt 60 test.txt
 统计行数: [root@linuxcool ~]# wc -l test.txt 4 test.txt
 打印最长行的长度: [root@linuxcool ~]# wc -L test.txt 23 test.txt
 |