Created
December 12, 2016 20:06
-
-
Save ivan-loh/88c77f32c3403bd5da8fd9ff62b36841 to your computer and use it in GitHub Desktop.
bash script to mass rename files in a directory
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/sh | |
SRCEXT="html" | |
DSTEXT="txt" | |
for file in *.$SRCEXT; do | |
echo "$file -> `basename "$file" .$SRCEXT`.$DSTEXT" | |
mv "$file" "`basename "$file" .$SRCEXT`.$DSTEXT" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment