grep指令的用法

grep '19/May/2020' error.log,在error.log文件中查找含有“19/May/2020”字段的行;

grep -c '19/May/2020' error.log,在error.log文件中查找含有“19/May/2020”字段的行数;

grep '19/May/2020' error.log | grep -c 'HTTP/1.1',在error.log文件中查找“19/May/2020”的行,然后在查找出的内容中查找含有“HTTP/1.1”的行数,这个属于多层嵌套。

 

暂时只用到这些功能~~~

posted @ 2020-05-31 23:27  乔儿  阅读(203)  评论(0编辑  收藏  举报