Re: how to change suffix for many files?
From: Icarus Sparry (usenet_at_icarus.freeuk.com)
Date: 03/10/05
- Next message: Bill Marcum: "Re: Removing lines from file"
- Previous message: Ted Timar: "Welcome to comp.unix.shell [Frequent posting]"
- In reply to: Dave Stewart: "how to change suffix for many files?"
- Next in thread: Michael A: "Re: how to change suffix for many files?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 10 Mar 2005 05:31:41 GMT
On Thu, 10 Mar 2005 00:02:19 -0500, Dave Stewart wrote:
> Suppose there are many files with suffix 'jpg' and I want to change the
> suffix to 'tif'.
> How can I do it in Unix? I try to use the following command,
>
> find . -name "*.jpg" | sed -e 's/\(.*\.\)jpg/mv \1jpg \1tif/' | xargs
>
> but it does not work. Could you please tell me what is wrong with the
> command?
Almost perfect. Feed it to 'sh' rather than 'xargs'.
> Is there any other way to do this? Thanks in advance!
Yes. 'mmv', perl, other forms of loops. A 3 second web search turned up
http://kb.indiana.edu/data/abec.html which claims to come from the FAQ.
However you have a good solution, so stick with it.
- Next message: Bill Marcum: "Re: Removing lines from file"
- Previous message: Ted Timar: "Welcome to comp.unix.shell [Frequent posting]"
- In reply to: Dave Stewart: "how to change suffix for many files?"
- Next in thread: Michael A: "Re: how to change suffix for many files?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|