I have a folder with multiple files in it, and I want to append .mp3 extension at end of each file. is there any way to rename all these files with one command.?
Asked
Active
Viewed 2,421 times
3 Answers
8
Assuming the files don't already have any extension at all, then run this from the directory containing the files :-
for file in * ; do mv "$file" "$file".mp3; done
If you want to be extra safe, do this instead :-
for file in * ; do cp "$file" "$file".mp3; done
This will make copies of the files and add .mp3, instead of renaming them. You can always delete the originals afterwards.
Or if you want a graphical interface for mass renaming of files, then have a look at PyRenamer in the Software Centre.
Carl H
- 6,316
- 6
- 28
- 42
3
and I want to append .mp3 extension at end of each file
short command
for f in *; do mv "$f" "$f.mp3"; done
A.B.
- 92,125