Created
April 14, 2019 05:55
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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