[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to rename multiple files



> drew cohan wrote:
> 
> > How do I rename all files in a directory matching the pattern *.JPG to
> > *.jpg in a bash shell script?  Thanks to you guys I can check for the
> > existence of jpgs in a directory, but can't seem get 'mv' to rename them
> > for me (always complains that the last argument must be a
> > directory).

You could try mmv (package mmv):
mmv - Move/Copy/Append/Link multiple files

the syntax here would be

  mmv '*.JPG' '#1.jpg'

It's neat, it can handle multiple regexes as a name and do operations
such as changing the case of matched parts and such.
The other commands provided by the package are called mcp, mln and so forth.

HTH,

Vinai
-- 
Secure eMail with gnupg: See http://www.gnupg.org/

Please avoid sending me Word, Excel or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

Attachment: pgpPL8WUoRYx5.pgp
Description: PGP signature


Reply to: