Advertisement
metalx1000

Sort all images by Year and Month

Oct 2nd, 2022
1,775
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.33 KB | Source Code | 0 0
  1. #!/bin/bash
  2.  
  3. which exiftool || sudo apt install exiftool
  4.  
  5. find -iname "*.jpg"|while read i;                                                                                        
  6. do
  7.   d="$(exiftool -T -DateTimeOriginal "$i"|awk '{print $1}'|cut -d\: -f1,2|tr ":" "/")";
  8.   [[ "$d" ]] && mkdir -p "$d" || d="."
  9.   mv -v "$i" "$d"
  10. done
Tags: BASH images EXIF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement