来源:https://www.opencli.com/zh-cn/linux/grep-or-and-operators
$ grep ‘pattern1|patten2’ file.txt $ grep -E ‘pattern1|pattern2’ file.txt $ egrep ‘pattern1|pattern2’ file.txt $ grep -e pattern1 -e pattern2 file.txt
$ grep ‘pattern1|patten2’ file.txt
$ grep -E ‘pattern1|pattern2’ file.txt
$ egrep ‘pattern1|pattern2’ file.txt
$ grep -e pattern1 -e pattern2 file.txt