更新时间:2023-12-04 19:39:34
您可以通过将模式放在文件中,并对grep使用 -f
命令行选项来避免此问题.
You can avoid the problem by putting the patterns in a file, and using the -f
command line option to grep.
最方便的方法是将每个替代项放在文件的单独行中:
The most convenient is to put each alternative in a separate line of the file:
^.\{6\}0000000012345
^.\{6\}0000000012543
grep -f patterns.txt somelargeFile.txt > outputFile.txt