Skip to content

Instantly share code, notes, and snippets.

@willmendesneto
Last active October 9, 2016 09:29
Show Gist options
  • Save willmendesneto/ad9ae4d004c453c9103e5cc23abac1e8 to your computer and use it in GitHub Desktop.
Save willmendesneto/ad9ae4d004c453c9103e5cc23abac1e8 to your computer and use it in GitHub Desktop.
Organize videos and images in media backup
#
# How to setup
#
# Navigates to your local backup folder
#
# chmod +x ./list-videos-backup.sh
# ./list-videos-backup.sh
#
CLI_FILES=$(ls)
ROOT_FOLDER=$(pwd)
while read -r line; do
cd "$line";
if [ -d ./Videos ]; then
echo "$line - You already have this folder";
else
mkdir Videos && mv *.{MOV,mp4} Videos;
fi
cd "$ROOT_FOLDER";
done <<< "$CLI_FILES"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment