Linux Grep命令-ov标志
我在玩grep命令,我注意到Linux Grep命令-ov标志,linux,grep,Linux,Grep,我在玩grep命令,我注意到grep-ovunixgeekfile.txt不起作用。 另一方面,grep-ov unix Geekfile.txt打印结果 我的Geekfile.txt是 Unix is great os. unix is opensource. unix is free os. learn operating system. Unix linux which one you choose. uNix is easy to learn. unix is a multiuser
grep-ovunixgeekfile.txt
不起作用。
另一方面,grep-ov unix Geekfile.txt
打印结果
我的Geekfile.txt是
Unix is great os.
unix is opensource.
unix is free os.
learn operating system.
Unix linux which one you choose.
uNix is easy to learn.
unix is a multiuser os.
Learn unix .
unix is a powerful
它不应该像这样打印其余的行吗:-
learn operating system.
Unix linux which one you choose.
uNix is easy to learn.
此选项不能同时使用
- -o、 --仅匹配仅显示线条匹配图案的一部分`
- -v、 --反转匹配选择不匹配的线
-v
获得唯一匹配,然后将其倒置-o
。它不会合并
grep -o unix file
unix
unix
unix
unix
unix
及
这两个命令是相同的。编辑您的问题以修复它,并解释什么是“不工作”
grep -v unix file
Unix is great os.
learn operating system.
Unix linux which one you choose.
uNix is easy to learn.