Skip to content

Instantly share code, notes, and snippets.

@emjayoh
Created January 12, 2022 15:21
Show Gist options
  • Save emjayoh/f21c304b3fde2caabbffb06a0a536591 to your computer and use it in GitHub Desktop.
Save emjayoh/f21c304b3fde2caabbffb06a0a536591 to your computer and use it in GitHub Desktop.
[remove spaces] removes pesky spaces from things like filenames #bash #terminal #copypaste
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