wc命令主要用来统计文件的行数(包括空行),加上相应的参数后还可以统计字符、字节数等
access.log中内如下
192.168.0.136 2017-02-25 http://vip.tx.com/charge/7daycharge?req=SDCOWEDDCDSFDS
10.200.124.242 2017-02-25 http://vip.tx.com/charge/7daycharge?req=VCJVLKSJDLESBSD
192.168.0.136 2017-02-25 http://vip.tx.com/charge/7daycharge?req=YEODLLDCDVSDDVDDE
10.200.124.242 2017-02-25 http://vip.tx.com/charge/7daycharge?req=VCJVLKSJDLSGSGS
统计该文件中行数
wc -l access.log
输出结果:
4 access.log
统计文件中的字符数
wc -m access.log
输出结果:
349 access.log