Last active
August 29, 2015 14:00
-
-
Save ajbonner/11038267 to your computer and use it in GitHub Desktop.
Mass Rename Files in a Dir Using Sed Expression
This file contains hidden or 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
#!/usr/bin/env bash | |
find . -name '*.gz' -print | while read SRC_FILE; do | |
DEST_FILE=$(echo $SRC_FILE | sed 's/_2014.*.sql.gz/.sql.gz/') | |
mv $SRC_FILE $DEST_FILE | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment