[linux-elitists] Re: GNOME > you

Greg KH greg@kroah.com
Tue Jan 6 11:33:40 PST 2004


On Mon, Jan 05, 2004 at 10:25:03PM -0500, Adam Kessel wrote:
> On Mon, Jan 05, 2004 at 06:21:29PM -0800, Karsten M. Self wrote:
> > For bulk renames or operations, the trick of generating a command,
> > _then_ executing it after double-checking that it does what's intended,
> > is common.  Rick Moen's publicized one such trick -- you generate code,
> > then pipe it through 'bash' when it's well-formed.
> 
> I know this is a little OT, but I was delighted to discover "rename"
> which comes packaged with perl (at least in Debian). E.g.: 
> 
> rename -n 's/^(\d)(.*).ogg$/$2$1.ogg/' *.ogg
> 
> (switch around leading numbers and text in filenames for a batch of ogg
> files) 
> 
> And if you want to see what it's going to do first, just add -n.

Hm, there seems to be a different 'rename' in util-linux.  Looks like
the perl one is a bit more powerful, need to try to dig it up (running
Red Hat rawhide here...)

thanks,

greg k-h



More information about the linux-elitists mailing list