Re: [Hampshire] mmv & wildcard expansion in bash

Top Page

Reply to this message
Author: Peter Salisbury
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] mmv & wildcard expansion in bash
On Monday 18 Jun 2007, john lewis wrote:
> I came across the mmv command whilst looking to see what
> http://debaday.debian.net/ had to offer and thought it would be
> useful for renaming a batch of images from my camera from
> p1010001.jpg through to p101015.jpg to something a little more
> useful like barbecue1.jpg through to barbecue15.jpg
>
> I thought this command would work
>
> mmv "*.jpg" "barbecue#1.jpg"
>
> but I ended up with barbecuep1010001.jpg and so on.
>


Hi John,

I don't use mmv but it looks from the man page that you need to be a
bit more specific with the match, eg:

mmv "p*.jpg" "barbecue#1.jpg"

should give you barbecue1010001.jpg etc

mmv "p????*.jpg" "barbecue#5.jpg"

should give you barbecue001.jpg etc

Alternatively use DigiKam which can create date-based subdirectories
and do dynamic renaming as you download from the camera (and all
sorts of other goodies such as remembering which ones you've already
downloaded, auto rotating etc).

HTH, Peter