作者:ii贵妇狗_156 | 来源:互联网 | 2023-05-18 16:27
1. 同时满足多个关键字
grep "word1" file_name | grep "word2" | grep "word3"
2. 满足任意关键字
grep -e "word1" -e "word2" -e "word3" file_name
3. 排除关键字
grep -v "word" file_name
Note:
cut (剪切摘取所需部分)
wc -l (计数)
sort (排序)
uniq (去重)