我试图用两个字符串grep文件的行,所以string1 logical_ AND string2.
示例行grep:
The quick brown fox and the cat
Run Code Online (Sandbox Code Playgroud)
我希望grep通过匹配"快速"和"猫"来排除那一行,注意"the"和"cat"之间的空格.这就是让我失望的原因.
grep .*quick.*cat myfile
Run Code Online (Sandbox Code Playgroud)
这工作正常,但我想grep "猫"和;
grep .*quick.*the cat myfile
Run Code Online (Sandbox Code Playgroud)
显然由于空间不起作用.我不明白我怎么能用空间包围"猫"?