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`}
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`}
Tags: duplicate files, timestamp
Posted in Unix | No Comments »
To find all files (regular files) modified after 12:00 AM today use
touch -t `date +%Y%m%d0000` /tmp/mintimestamp find /path/to/search/for -type f -newer /tmp/mintimestamp rm /tmp/mintimestamp
The trick is to timestamp /tmp/mintimestamp with the timestamp that we want to compare against.
So you would use the touch command below in the above set of commands to find all files modified after 12:00 AM on Jan 1, 2008:
touch -t `date 200801010000` /tmp/mintimestamp
Tags: find files, timestamp, touch
Posted in Unix | No Comments »
my two cents is proudly powered by
WordPress
Entries (RSS)
and Comments (RSS).