Search this site





Powershell to remove dotfiles

I just rsync'd all willy-nilly (not something I recommend). I copied stuff I was working on to a test windows box. Poking around, I realized I copied over a pile of dotfiles (.svn, vim backup files, etc).

In any bourne shell, this fix would be a simple find invocation (depending on how modern your find(1) is):

 find somepath -name '.*' -delete 
Back in Windows, my first reaction was to be sad because I didn't know a simple oneliner to do the same thing. Then, I remembered powershell was installed and made this kind of stuff easy.
 dir -recurse | where {$ -match "^\."} | rm