02.grep
[toc]{type: “ol”, level: [2, 3, 4, 5]}
grep 文本搜索工具
grep [option] file
option
--color=auto 对匹配到的行添加颜色
-v 取反
-i 不区分大小写
-n 查找的内容增加行号
-c 打印匹配到的行数
-o 只显示匹配到的文字
-q 静默模式
-A * after 向下显示*行
-B * before 向上显示*行
—C * context 上下分别显示*行
-e 或者 grep -e 'user' -e 'root' passwd
-E 扩展正则表达式
-F 不使用正则表达式
-r 递归
-w 匹配整个单词