Search This Blog

Thursday, March 10, 2011

Rename file using the current date and time

( Unix Version )

mv /file/path/filename.txt /file/path/filename_$(date +"%m%d%y%H%M%S").txt

Rename file using the current date and time ( Windows Version )


ren C:\file\path\filename.txt %time:~0,2%%time:~3,2%%time:~6,2%_%date:~4,2%%date:~7,2%%date:~10,4%_filename.txt