天天看点

wc统计文件的行数、字节数、单词数

一、说明

        wc 命令用来统计文件的行数、字节数、单词数、字符数的信息。

二、参数

        1、-l        统计行数。

        2、-L        统计打印最长那一行的长度。

        3、-c        统计文件的字节数。

        4、-w        统计文件的单词数。

        5、-m        统计文件的字符数。

[[email protected] test]# 
[[email protected] test]# wc -c more.txt ## 统计文件的字节数
90332 more.txt
[[email protected] test]# wc -w more.txt ## 统计文件的单词数量
12658 more.txt
[[email protected] test]# wc -m more.txt ## 统计字符数
90190 more.txt
[[email protected] test]# wc -l more.txt ## 统计行数
999 more.txt
[[email protected] test]# wc -L more.txt ## 打印最长的那一行的长度
151 more.txt
[[email protected] test]#