title: How retrieve the creation date of photos with a script
body: <p>What I want to do is reorganize files in my Camera Roll folder. Using the creation date I want to Put them inside folders according to Year/Month Format using their creation date.</p>
  
  <p>In this answer, they explain how to make folders and organize them:
  <a href="https://stackoverflow.com/a/1314394/4980886">https://stackoverflow.com/a/1314394/4980886</a></p>
  
  <pre><code>#!/bin/bash
  find $PHOTO_DIR -regextype posix-extended -type d -regex '.*/[0-9]{4}/[0-9]{2}/[0-9]{2}$' |
  while read dir; do
      newdir="$(echo $dir | sed 's@/\([0-9]\{4\}\)/\([0-9]\{2\}\)/\([0-9]\{2\}\)$@/\1-\2-\3@')"
      mv "$dir" "$newdir"
      rmdir "$(dirname $dir)"
      rmdir "$(dirname $(dirname $dir))"
  done
  </code></pre>
  
  <p>But it doesn't address how to get the creation date, maybe I should get the metadata from EXIF data. How to do either?</p>