有没有办法删除所有同名目录?

Is there a way to delete all directories with the same name?

长话短说,我正在尝试删除我站点中的所有 .svn 文件夹。

我试过使用文件掩码:*/.svn/*

搜索:/data/www/content/

但它正在返回名为条目的文件。它向我显示了条目文件显示的所有目录,这很有用,但我需要转到该目录并一次删除一个。

小帮助弹出窗口说以 / 结尾的掩码会找到文件夹,所以我尝试了 .svn/,它确实在当前文件夹中找到了。但它不会在子文件夹中递归搜索。

由于您使用的是 WinSCP,因此您 probably have Bash or SSH access too, you could try one of the scripts mentioned in this Whosebug question: How to remove all .svn directories from my application directories

如果需要重复做这个任务,可以写一个PowerShell script using WinSCP .NET assembly

已经提供了一个 Search recursively for text in remote directory 示例。

你的任务没有什么不同。您没有下载 ($session.GetFiles) 并搜索匹配文件,而是将其删除 ($session.RemoveFiles)。