Skip to content

Instantly share code, notes, and snippets.

@nabinno
Created September 16, 2014 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nabinno/0d140d5eb0935ee27523 to your computer and use it in GitHub Desktop.
Save nabinno/0d140d5eb0935ee27523 to your computer and use it in GitHub Desktop.
function rename () {
for i in *$1* ; do
\mv $i `echo $i | sed -e s,$1,$2,g`
done
}
alias rn="rename"
# recusively
function rename-recursively () {
find . | while read file ; do
\mv $file ${file//$1/$2}
done
}
alias rnr="rename-recursively"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment