gpt4 book ai didi

macos - 查找不等于模式的文件

转载 作者:行者123 更新时间:2023-12-01 05:00:28 24 4
gpt4 key购买 nike

关闭。这个问题是off-topic .它目前不接受答案。












想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。

9年前关闭。



Improve this question




我想找到所有不等于 .git* 的文件/目录,所以我尝试了以下命令,但它有相反的效果(它打印包含 .git 的路径)。

$ find . ! -name "*.git"
$ find . ! -name ".*.git"
$ find . ! -name "*.git*"
$ find . ! -regex "*.git"
$ find . ! \( -name "*.git*" \)

我还用 \! 尝试了上述命令逃脱,如 find . \! -name "*.git" .

问: find 的正确语法是什么? “不等于”?

最佳答案

啊哈!我在这里找到了:

$ find . ! -path "*.git*"

关于macos - 查找不等于模式的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9816739/

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