正在表达式 或者 |
grep "worldA\|worldB" test.txt
?
或者用加上(), 参见正在表达式的元字符:方括号的含义2: ?选择性
grep "(worldA\|worldB)" test.txt