Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: changing file names 'on the fly'
- X-seq: zsh-users 14315
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: changing file names 'on the fly'
- Date: Sat, 22 Aug 2009 15:44:35 +0200
- In-reply-to: <h6osb5$b38$1@xxxxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <h6osb5$b38$1@xxxxxxxxxxxxx>
Pol <xtekhne@xxxxxxxxx>:
> I would like to change file names while copying or moving.
> In my case, i would change all files ending with ".lyx14" into ".lyx".
> Any hints?
In this case, a simple loop would do:
for i in *.lyx14; do mv -- "$i" "${i:r}.lyx"; done
If you need to do more complex renames, see:
% man zshcontrib | less -p zmv
Regards, Frank
--
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
Messages sorted by:
Reverse Date,
Date,
Thread,
Author