27 Jun 14:53
Re: Rename multiple files at once
From: Olivier Mehani <shtrom <at> ssji.net>
Subject: Re: Rename multiple files at once
Newsgroups: gmane.os.openbsd.misc
Date: 2007-06-27 12:53:05 GMT
Subject: Re: Rename multiple files at once
Newsgroups: gmane.os.openbsd.misc
Date: 2007-06-27 12:53:05 GMT
On Wed, Jun 27, 2007 at 02:37:07PM +0200, Pieter Verberne wrote:
> How do I rename multiple files at once? I want to rename a list of
> files like:
> file.jpg
> file1.jpg
> file_2.jpg
> to:
> file_thumb.jpg
> file1_thumb.jpg
> file_2_thumb.jpg
Using bash, you can do something like that:
for file in file.jpg file1.jpg file_2.jpg; do
mv $file ${file/.jpg/_thumb.jpg}
done
--
Olivier Mehani <shtrom <at> ssji.net>
PGP fingerprint: 3720 A1F7 1367 9FA3 C654 6DFB 6845 4071 E346 2FD1
[demime 1.01d removed an attachment of type application/pgp-signature]
RSS Feed