我想做与 grep 相反的事情。我想排除具有特定模式的输出行。
我想要的是一个命令“ngrep”:
$ output
hi how are you?
hi hi haw are you?
hu hi how are you?
haw haw haw are you?
$ output | ngrep 'haw' :
hi how are you?
hu hi how are you?
答案1
从grep
手册页:
-v, --invert-match
Invert the sense of matching, to select non-matching lines.