如何使“grep”从文件中读取模式? [英] How to make "grep" read patterns from a file?
本文介绍了如何使“grep”从文件中读取模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
egrep -v'patter1 | pattern2 | pattern3
。现在如果所有这些模式都在一个文本文件中呢?什么是使 grep -v -f pattern_file
Suppose there is a large text file and I would like to print only the lines that do not match some patterns. Obviously, I can use egrep -v 'patter1|pattern2|pattern3
. Now what if all those patterns are in a text file ? What is the best way to make egrep
read patterns from the file ?
解决方案
grep -v -f pattern_file
这篇关于如何使“grep”从文件中读取模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文