Created
July 23, 2014 20:45
-
-
Save bsalex/e22c0e66da0f20214366 to your computer and use it in GitHub Desktop.
Console command to renames all files and subdirectories replaceing spaces with "_" in their names
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name "*\ *" -type f -exec sh -c 'mv "{}" "`echo \"{}\" | sed \"s/ /_/g\"`"' \; && find . -depth -name "*\ *" -type d -execdir sh -c 'mv "{}" "`echo "{}" | sed "s/ /_/g"`"' \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment