Skip to content

Instantly share code, notes, and snippets.

@caio-nas
Created September 3, 2013 16:57
Show Gist options
  • Select an option

  • Save caio-nas/6426551 to your computer and use it in GitHub Desktop.

Select an option

Save caio-nas/6426551 to your computer and use it in GitHub Desktop.
#In Bash and zsh you can do this with Brace Expansion. This simply expands a list of items in braces. For example:
# echo {vanilla,chocolate,strawberry}-ice-cream
#vanilla-ice-cream chocolate-ice-cream strawberry-ice-cream
#So you can do your rename as follows:
mv {,new.}original.filename
#as this expands to:
#mv original.filename new.original.filename
#source: http://stackoverflow.com/questions/208181/how-to-rename-with-prefix-suffix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment