grep文本搜索
grep match_patten file //默认访问匹配行
常用参数 -o 只输出匹配的文件行 -v 只输出没有匹配的文本行 -c 统计文件中包含文本的次数(行数)
grep -c
"text" filename
-n 打印匹配的行数 -i 搜索时忽略大小写 -l 只打印文件名
在多级目录中对文本递归搜索
grep
"patten_string1" . -R -n
匹配多个模式
grep
-e "patten_string1" -e "patten_string2" file
grep输出以\0作为结尾符的文件名:(-z)
grep
"test" file*
-lZ| xargs -
0 rm
后续补充~~~~