I have a folder with many files named as '00001.sdf', '00002.sdf' and so on. I want to add an 'M' character at the beginning of each file name, like this 'M00001.sdf', 'M00002.sdf. How can I do this using a bash command?
Asked
Active
Viewed 174 times
-1
-
1I copy pasted the title of your question in google and [Rename all files in directory from $filename_h to $filename_half?](http://stackoverflow.com/questions/7450818/rename-all-files-in-directory-from-filename-h-to-filename-half) was the first result. – f3xy May 04 '17 at 14:42
3 Answers
0
Alternatively if you have perl
version of the rename
utility:
rename 's/^0/M0/' *

Arkadiusz Drabczyk
- 11,227
- 2
- 25
- 38