Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for f in ~/Desktop/*; do
- old=$(stat -f %B -t %s "$f")
- touch -t $(date -r $(($old - 1234567)) +%Y%m%d%H%M%S) "$f"
- done
- for f in ~/Desktop/*; do
- old=$(stat -f %B -t %s "$f")
- new=$(date -r $(($old + 1234567)) '+%m/%d/%Y %H:%M:%S')
- SetFile -d "$new" -m "$new" "$f"
- done
- ref_file=GOPR3440.MP4
- new_time_for_that_file=0327160015 #date's format: 27th March 2015, 16:00
- ref_file_timestamp=`stat -f %B -t %s "$ref_file"`
- new_time_timestamp=`date -j $new_time_for_that_file +%s`
- time_diff=$[$new_time_timestamp - $ref_file_timestamp]
- for f in *; do
- old=$(stat -f %B -t %s "$f")
- new=$(date -r $(($old + $time_diff)) '+%m/%d/%Y %H:%M:%S')
- SetFile -d "$new" -m "$new" "$f"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement