Skip to content

Instantly share code, notes, and snippets.

@iambibhas
Last active October 13, 2022 17:41
Show Gist options
  • Save iambibhas/d4c5603b4989692e5ace to your computer and use it in GitHub Desktop.
Save iambibhas/d4c5603b4989692e5ace to your computer and use it in GitHub Desktop.
Move your images to creation date wise folders
#!/bin/sh
SRC_DIR=$1
DEST_DIR=$2
for _file in `find $SRC_DIR -type f`;
do
DATE=`date -r $_file +%F`
DIR="$DEST_DIR$DATE"
echo "$_file -> $DIR"
mkdir -p $DIR
cp -n $_file $DIR
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment