0

Long story short, I am trying to delete all .svn folders within my site.

I have tried to use a file mask: */.svn/*

Search in: /data/www/content/

But it's returning files named entries. It shows me all the directories the entries file is showing in which is helpful, but then I need to go to that directory and delete them one at a time.

2 Answers2

2

The small help popup says that masks ending in / will find folders, so I tried .svn/ and it does find that in the current folder. But it does not search recursively in sub folders.

Since you are using WinSCP you probably have Bash or SSH access too, you could try one of the scripts mentioned in this Stackoverflow question: How to remove all .svn directories from my application directories

Community
  • 1
  • 1
chrki
  • 6,143
  • 6
  • 35
  • 55
  • Thanks for finding that for me. The answer from that question worked: find . -name .svn -exec rm -rf {} \; –  Feb 01 '15 at 23:12
0

If you need to do this task repeatedly, you can write a PowerShell script using WinSCP .NET assembly.

There's already a Search recursively for text in remote directory example provided.

Your task is not that different. Instead of downloading ($session.GetFiles) and grepping a matching file, you delete it ($session.RemoveFiles).

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992