gpt4 book ai didi

linux - 如何从所有子目录中递归删除具有特定名称的所有文件夹?

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

这是一些目录路径的示例

find . -name .svn;

./application/views/scripts/soft/.svn
./application/views/scripts/sitemap/.svn
./application/views/scripts/register/.svn
./application/views/scripts/home/.svn
./application/views/scripts/terms-of-service/.svn
./application/views/scripts/promotions/.svn
./application/views/scripts/test/.svn
./application/views/scripts/privacy-policy/.svn
./application/views/scripts/services/.svn
./application/views/scripts/mobile/.svn
./application/test/.svn
./application/public/.svn

我想从我所在的当前根目录中一次性删除所有这些目录中的所有 .svn 文件夹。

有deas吗?

最佳答案

您可以这样做(将 -type d 添加到您的查找命令以仅获取文件夹)

rm -rf `查找 . -type d -name .svn`

关于linux - 如何从所有子目录中递归删除具有特定名称的所有文件夹?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35352590/

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