I have a couple of files with ".old" extension.
How can I remove the ".old" extension without remove the file?
I can do it manually but with more work:
mv file1.key.old file1.key
mv file2.pub.old file2.pub
mv file3.jpg.old file3.jpg
mv file4.jpg.old file4.jpg
(etc...)
The command will work with other extensions too?
example:
mv file1.MOV.mov file1.MOV
mv file2.MOV.mov file2.MOV
mv file3.MOV.mov file3.MOV
(etc...)
or better:
mv file1.MOV.mov file1.mov
mv file2.MOV.mov file2.mov
mv file3.MOV.mov file3.mov
(etc...)
for file in *.old; do mv "$file" "${file%%.old}"; done
worked, Thanks – DiogoSaraiva Jan 21 '15 at 14:02