Created
April 19, 2018 01:30
-
-
Save webbedfeet/8d8fb8d764aafc3fdfe89817ba7d043d to your computer and use it in GitHub Desktop.
Replace spaces in filenames/directories recursively
This file contains hidden or 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 "* *" -print0 | sort -rz | \ | |
while read -d $'\0' f; do mv -v "$f" "$(dirname "$f")/$(basename "${f// /_}")"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment