I have a folder on the server that contains directories that are created daily and are named by date, like so:
07-06-14
08-06-14
09-06-14
etc.
At some point I decided that a preferred naming would be in the following format: 2014-06-07 And the new folders get created with that format. So now the folder contains both: directories in old format and the new one.
How do I batch-rename the directories in the old format to the new one?
I've tried this: rename -n 's/(\d{2})\-(\d{2})\-(\d{2})\20$3-$2-$1//' *
But it throws errors:
Use of uninitialized value $2 in regexp compilation at (eval 1) line 1