grep -v 反选匹配内容(not操作)以及grep -E(or操作)

grep not操作

使用 grep -v 可以实现反向选择操作

如:筛选出test.txt文本中不包含匹配内容的行

grep or操作

1、使用 grep -E 可以实现or操作(也可以写成egrep)

如:筛选出test.txt文本中包含“a”或“b”的行

2、使用| 也可以实现or操作

用例:grep "a|b" test.txt

原文地址:https://www.cnblogs.com/Mrq-t/p/12788398.html