我跑
man gcc | grep "-L"
我明白了
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
如何 grep 匹配?
最佳答案
man gcc | grep -- "-L"
请注意参数“--”,这意味着“不要将后面的任何内容视为选项”。
此外,如果您采纳错误消息中的建议运行“grep --help”,它会显示您还可以使用 -e/--regexp 选项显式设置模式。
man gcc | grep -e "-L"
man gcc | grep --regexp="-L"
关于gcc - 无法 grep 特定格式的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/996095/