Last active
December 18, 2015 23:28
-
-
Save kevinsalter/5861456 to your computer and use it in GitHub Desktop.
Search and replace on command line to rename files
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
# change *.* to *.jpg to only target JPGs, for example | |
# and to customize the search... | |
# sed -e 's, what you're searching for goes in this space , what you want to replace it with goes here ,g' | |
#the default example here with turn spaces into nothing ( i.e. remove all spaces from file names ) | |
for i in *.*; do mv "$i" "`echo $i | sed -e 's, ,,g'`"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment