Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save YourFriendCaspian/0e69c53c6b38f9743989c9ea6617690c to your computer and use it in GitHub Desktop.
Save YourFriendCaspian/0e69c53c6b38f9743989c9ea6617690c to your computer and use it in GitHub Desktop.
Replace spaces in filenames with underscores
find -name "* *" -type d | rename 's/ /_/g' # directories
find -name "* *" -type f | rename 's/ /_/g' # files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment