grep -E "word1|word2|word3" file.txt # 满足任意条件(word1、word2和word3之一)将匹配。 grep word1 file.txt | grep word2 |grep word3 # 必须同时满足三个条件(word1、word2和word3)才匹配。
# grep 同时排除多个关键字 # 不说废话, 例如需要排除 abc.txt 中的 mmm nnn grep -v 'mmm\|nnn' abc.txt
标签:grep,Linux,关键字,word1,word3,word2,txt From: https://www.cnblogs.com/JetpropelledSnake/p/17814494.html