Skip to content

Instantly share code, notes, and snippets.

@madranet
Created January 24, 2025 16:58
Show Gist options
  • Select an option

  • Save madranet/3365553417fb9b0159e0161ec784bf8e to your computer and use it in GitHub Desktop.

Select an option

Save madranet/3365553417fb9b0159e0161ec784bf8e to your computer and use it in GitHub Desktop.
Further sort photos into sub-subfolders by type; Raw, JPG, Video [Change extensions as appropriate]
find . -type f \( -iname "*.raf" -exec sh -c 'mkdir -p "$(dirname "$1")/Raw" && mv "$1" "$(dirname "$1")/Raw/"' _ {} \; \) \
-o \( -iname "*.jpg" -exec sh -c 'mkdir -p "$(dirname "$1")/JPEGs" && mv "$1" "$(dirname "$1")/JPEGs/"' _ {} \; \) \
-o \( -iname "*.mov" -exec sh -c 'mkdir -p "$(dirname "$1")/Video" && mv "$1" "$(dirname "$1")/Video/"' _ {} \; \)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment