Posts Tagged ‘duplicate files’

How to duplicate a file with the current date and time

Tuesday, September 29th, 2009

To duplicate (backup) a file as filename.unixtimestamp use

cp myfilename{,.`date +%s`}

You can change the date format as per your preference. Below would duplicate it as filename.yyyymmdd

cp myfilename{,.`date +%Y%m%d`}