I have multiple folders and each one have around 175 files in it. file names are like
1.wav
2.wav
3.wav
......
175.wav
I have to rename them as
A1.wav
A2.wav
A3.wav
......
A175.wav
In other words I have to append Letters in previous file names.
I am wondering if there is a easy way to do this.
Ubuntu Version is 16.10
^(.*)
makes the whole name to be treated as$1
. So you're literally sticking A at the end of whole name. What you want to do is use extra grouping, make$1
be everything before.wav
and make.wav
be$2
. Like this:prename -nv 's/^(.*)(.wav)$/$1A$2/' *.wav
So here first(.*)
will be$1
and is everything before.wav
. The second group(.wav)
is$2
– Sergiy Kolodyazhnyy Jun 07 '17 at 17:06