Hello I'm using Putty and trying to rename a file name with current timestamp.
I've used following command to rename the files and according to date
mv abc.log $(date +%F)prod.txt
Above command renames but not able to rename with time, it giving output as
2014-05-12prodabc.log
And following command
abc.log $(date +%y)$(date +%m)$(date +%d)abcprod.log
giving output as
140512abc.log
Actually my requirement is as following:
- Rename
abc.log
toabc-<current timestamp>.log
- e.g
abc.log
becomeabc-12-05-2014-17:31.log
- e.g
- Then create new file
abc.log
Please Help, Thanking you all in advance.