Created
June 19, 2018 04:27
-
-
Save devm33/a6d88ddeef210b48cef6bf197bef8781 to your computer and use it in GitHub Desktop.
Change the accessed / modified (and created on mac if older) of a bunch of photos to sort by date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for f in *.jpg | |
do | |
num=${f//[^0-9]/} | |
secs=${num:0:4} | |
mmss=$(printf '%02d%02d\n' $((10#$secs/60)) $((10#$secs%60))) | |
touch -mt 20180528${mmss} $f | |
touch -t 20180528${mmss} $f | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment