Skip to content

Instantly share code, notes, and snippets.

@jefffis
Created February 28, 2014 17:50
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 jefffis/9275966 to your computer and use it in GitHub Desktop.
Save jefffis/9275966 to your computer and use it in GitHub Desktop.
Replace spaces in filenames with dashes
for i in *.[file_ext]; do mv "$i" "`echo $i | sed -e 's, ,-,g'`"; done
## where file_ext is something like png, gif, or jsp
## src: http://www.chrislongcreativeservices.com/replacing-spaces-in-file-names-on-osx/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment