Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Moving multiple files....


On 17 Apr 2006, Benno <benjl@xxxxxxxxxxxxxxx> wrote:

> If you are using zsh, it has a neat feature where you can glob down multiple
> directories. E.g:
> 
> mv /photos/**/*.jpg /newphotos
> 
> Will match all .jpg files under photos. But you will end up with all those jpgs
> in the one directory which is probably not what you want. Another problem is that
> you can only have so many arguments on the command line, and if your photo collection
> is large that won't work.

A related neat zsh trick is 

  for i in *.JPG; do mv -v $i ${i:l}; done

to squash everything to lowercase, which can be nice when they're coming
from a flash card onto Unix.

-- 
Martin