Skip to content

Instantly share code, notes, and snippets.

@dpdexter
Created November 3, 2011 18:55
Show Gist options
  • Save dpdexter/1337437 to your computer and use it in GitHub Desktop.
Save dpdexter/1337437 to your computer and use it in GitHub Desktop.
Bash Rename Files
for i in REG_* ; do mv $i `echo $i | sed 's/REG_//'`; done
@dpdexter
Copy link
Author

To Rename the extension:

for i in *.jpg; do mv "$i" "basename $i .jpg.JPG"; done

@dpdexter
Copy link
Author

for file in *.png; do mv "$file" "basename $file .png.jpg"; done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment