I am using Linux Slackware 14.0, bash 4.2. Suppose, I have 2 files in the directory:
bash-4.2$ ls
1.txt 2.txt
I want to rename them to .svg. This answer is accepted and upvoted, so I think, it must work. He used this command:
find . -name "*.andnav" -exec rename -v 's/\.andnav$/\.tile/i' {} \;
So, I wrote the analogous command, but it printed an error:
bash-4.2$ find . -name "*.txt" -exec rename -v 's/\.txt$/\.svg/i' {} \;
rename: not enough arguments
When I want to just print the files, it works:
bash-4.2$ find . -name "*.txt" -print
./1.txt
./2.txt
I know, that I can rename with a simpler approach:
bash-4.2$ rename .txt .svg ./*.txt
bash-4.2$ ls
1.svg 2.svg
But why doesn't the command from that answer work for me?
perl
(which that answer assumes) and the one from util-linux (which you have). – Stéphane Chazelas Jun 07 '13 at 20:36find . -name '*.txt' -exec rename .txt .svg {} +
– Stéphane Chazelas Jun 07 '13 at 20:41info --index-search=-exec find
– Stéphane Chazelas Jun 07 '13 at 20:50