Static Oneplus 不可控制论

2012/12/10 - by • Shellgrep

Grep的若干小技巧


匹配不符合模式的字符串

grep -v "pattern" file

模板中含有\t

grep -P "^\t" file

两文件差集(B.txt-A.txt)

grep -F -v -f A.txt B.txt

用A.txt文件中的词表查B.txt

grep -f A.txt B.txt

与Pipe配合

cat B.txt | grep -f A.txt

还有

cat A.txt | grep -f - B.txt

参考

blog comments powered by Disqus