Skip to content

Instantly share code, notes, and snippets.

@npero
Created January 4, 2013 15:40
Show Gist options
  • Select an option

  • Save npero/4453544 to your computer and use it in GitHub Desktop.

Select an option

Save npero/4453544 to your computer and use it in GitHub Desktop.
Batch script to replace spaces by underscore in list of filenames (recursively).
find . -name "*.doc" | while read file; do new_file=$(echo $file | sed s/\ /_/g); mv "$file" "$new_file"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment