Skip to content

Instantly share code, notes, and snippets.

@nixin72
Created April 14, 2019 05:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nixin72/6f5f2cedd25ebbb94bd6f67dfdf3247c to your computer and use it in GitHub Desktop.
Save nixin72/6f5f2cedd25ebbb94bd6f67dfdf3247c to your computer and use it in GitHub Desktop.
Just a quick script that will take all of the XXXAPPLE directories when you import all your images from iOS into Windows and bring them all up into a top level directory so that you don't have to go through dozens or hundreds of folders yourself.
#!/bin/bash
cd $1
while read -r dir; do
cd $(pwd)"/"$dir
while read -r file; do
mv $(pwd)"/"$file $OLDPWD"/"$file
done < <(ls -l | grep -Pi "IMG_\d{4}.(MOV|JPG|PNG)" -o)
cd ..
done < <(ls -l | grep -P "\d{3}APPLE" -o)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment