Attaching Timestamps / Date stamps with file name in linux

Posted: 30th December 2011 by admin in Bash

Hi Folks, some times when we are working with backups we have to assign year, month and date datestamp to out files. 

 

  • Below command gives you time "20111212" format

date +%Y%m%d

 

  • If you have to use above with e.g copy command

cp test.zip /home/user/test_back_$(date +%Y%m%d).zip