Skip to content

Instantly share code, notes, and snippets.

@AtomicSmash
Created October 15, 2013 20:07
Show Gist options
  • Save AtomicSmash/6997822 to your computer and use it in GitHub Desktop.
Save AtomicSmash/6997822 to your computer and use it in GitHub Desktop.
Bash script to replace underscores
find . -depth -name '* *' \
| while IFS= read -r f ; do mv -i "$f" "$(dirname "$f")/$(basename "$f"|tr ' ' _)" ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment