wc命令
来源:原创 更新时间:2018-08-22 21:36:07 作者:管理员 浏览:2271
- 命令描述
- 命令语法
- 命令选项
-l或--lines只显示行数。
-w或--words只显示字数。
-L 统计最行所占的字节
--help在线帮助。
--version显示版本信息。
- 命令实例
实例1:统计总行号
[root@baodian tmp]# wc -l test.txt 5 test.txt
实例2:统计字符数
[root@baodian tmp]# wc -c test.txt 48 test.txt
实例3:统计单词数
[root@baodian tmp]# wc -w test.txt 9 test.txt
实例4:显示最长行的长度
[root@baodian tmp]# wc -L test.txt 显示最长行的字节数, 16 test.txt
实例5:统计/etc目录3级目录中文件的个数
[root@baodian ~]# find /etc -maxdepth 3 -type f | wc -l 640 #每个系统下面的值可能会不一样