gpt4 book ai didi

linux - 带通配符的grep递归不起作用

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:55:28 25 4
gpt4 key购买 nike

$ grep -r 9900 *.mk
grep: *.mk: No such file or directory
$ grep -R 9900 *.mk
grep: *.mk: No such file or directory

$ grep -V
GNU grep 2.5.4

我是否使用了错误的 grep?或者语法是什么?谢谢!

最佳答案

您可以使用包含标志:

grep -r --include="*.mk" 9900 .

grep 手册页说:

--include : If specified, only files matching the given filename pattern are searched.

关于linux - 带通配符的grep递归不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20133701/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com