我有一个包含“then”和“there”的文件。
我可以
$ grep "then " x.x
x and then some
x and then some
x and then some
x and then some
Run Code Online (Sandbox Code Playgroud)
我可以
$ grep "there " x.x
If there is no blob none some will be created
Run Code Online (Sandbox Code Playgroud)
如何在一次操作中同时搜索两者?我试过
$ grep (then|there) x.x
Run Code Online (Sandbox Code Playgroud)
-bash: 意外标记附近的语法错误`('
和
grep "(then|there)" x.x
durrantm.../code
# (Nothing)
Run Code Online (Sandbox Code Playgroud)