I don't know what your problem is. What you've posted works:
$ mkdir test
$ touch test/test{01..10}.run
$ rename 's/\.run$/.clu/' test/*.run -vn
test/test01.run renamed as test/test01.clu
test/test02.run renamed as test/test02.clu
test/test03.run renamed as test/test03.clu
test/test04.run renamed as test/test04.clu
test/test05.run renamed as test/test05.clu
test/test06.run renamed as test/test06.clu
test/test07.run renamed as test/test07.clu
test/test08.run renamed as test/test08.clu
test/test09.run renamed as test/test09.clu
test/test10.run renamed as test/test10.clu
The -vn
is just telling us what it would do if run without it.
I'm escaping the dot (otherwise it's a REGEX "anything") but it really makes no difference here. It works as well without it.
Is it possible that you're actually running rename.ul
? Check to make sure you're using the Perl rename (which takes the syntax we're using) with dpkg -S $(readlink -f $(which rename))
perl: /usr/bin/prename
is good.
util-linux: /usr/bin/rename.ul
is bad. For some reason you're using a very limited version of rename. Something very squiffy has happened.
For the moment, see if prename
exists (you could just use that for now) and if not, start asking why Perl isn't installed properly. It would suggest you don't have Ubuntu installed.
Or if you're happy using rename.ul
, the following should work:
rename.ul .run .clu *.run
But that might munch a file like test.run.hooray.run
into test.clu.hooray.clu
which obviously isn't great.
ls
or whatever is useful.for file in *.run ; do mv -f $file `echo $file | sed 's/\(.*\.\)run/\1clu/'` ; done
this works.