Skip to content

Instantly share code, notes, and snippets.

@meowmeowxw
Created July 27, 2022 17:34
Show Gist options
  • Save meowmeowxw/fbd88c38e5444d85161c4cba8ec17938 to your computer and use it in GitHub Desktop.
Save meowmeowxw/fbd88c38e5444d85161c4cba8ec17938 to your computer and use it in GitHub Desktop.
Find images in subdirectories
#!/bin/bash
mkdir images
for f in $(find . -type f); do file $f | grep image; [ $? -eq 0 ] && cp $f ./images/$(date '+%F' -d "@$( stat -c '%Y' "$f";)")_$(basename $f);done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment