I'm trying to currently rename a large set of files and have been using quite kludgy methods to do so, such as:
rename 's:(.*)\.MOV:$1.mov:g' *.MOV
rename 's:(.*)\.JPG:$1.jpg:g' *.JPG
What I'd really like to do is to be able to combine all of these commands using the 'y' sed
operator. Evidently, using this operator, you can transform items to lower case. The problem is that I need to convert only the extensions. Is there a way to do this using this command? I need to essentially transform the capture group in the following expression to lowercase: ^.+\.(.+)$
. Is there a way to do this? I'm kind of new to these kinds of transformations.
:r
and:e
in zsh? They make the command simpler. – Gilles 'SO- stop being evil' May 19 '17 at 10:44$f
, which wasn't documented. Now I've decided that I'll use$f
anyway, and I see it's finally been added to the documentation. – Gilles 'SO- stop being evil' May 19 '17 at 11:06