Support
Forums

Re: Changing date format in filenames in Linux

Keith,Bingo.m@m-xubuntu:~/scripts$ touch dd-mm-yyyy.mp3m@m-xubuntu:~/scripts$ touch DD-MM-YYYY.txtm@m-xubuntu:~/scripts$ lsdd-mm-yyyy.mp3  DD-MM-YYYY.txt  name-reformatm@m-xubuntu:~/scripts$ name-reformatOld file: dd-mm-yyyy.mp3 new file: yyy...
Keith,

Bingo.

m@m-xubuntu:~/scripts$ touch dd-mm-yyyy.mp3
m@m-xubuntu:~/scripts$ touch DD-MM-YYYY.txt
m@m-xubuntu:~/scripts$ ls
dd-mm-yyyy.mp3  DD-MM-YYYY.txt  name-reformat
m@m-xubuntu:~/scripts$ name-reformat
Old file: dd-mm-yyyy.mp3 new file: yyyy-mm-dd.mp3
m@m-xubuntu:~/scripts$ 

I think your example output reversed the new and old filenames, but your script go it spot on.