【Linux 命令】--- grep 和 find
grep
作用:使用正则表达式搜索文本。
选项:
-n:显示行号。
-r:递归查找。
-s:不显示不存在或无匹配的错误信息。
-i:不区分大小写。
--color=auto:将匹配到的关键词加上颜色。
例子:
grep -snr "str1" path1
"str1":显示含有str1行。
"^str1":显示开头为str1的行。
"str1$":显示结尾为str1的行。
...
原创
2019-01-02 10:42:02 ·
323 阅读 ·
0 评论