Last active
June 10, 2018 18:04
-
-
Save asperduti/44bc861a628905474a7e5903ea2a8309 to your computer and use it in GitHub Desktop.
Set date created/modified of a files in directory with the date in its name
This file contains 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
for f in *.jpg; do filename=$(echo $f | cut -d'.' -f 1); date=$(echo $filename | cut -d'_' -f 2)$(echo $filename | cut -d'_' -f 3); date=$(echo $date | cut -c1-12);echo $date; touch -t $date "$f"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment