Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garybunofsky/19317e86d4db57936147ade5e2bac2c2 to your computer and use it in GitHub Desktop.
Save garybunofsky/19317e86d4db57936147ade5e2bac2c2 to your computer and use it in GitHub Desktop.
find . -depth -name '* *' \
| while IFS= read -r f ; do mv -i "$f" "$(dirname "$f")/$(basename "$f"|tr -d [:space:])" ; done
@garybunofsky
Copy link
Author

garybunofsky commented Oct 9, 2019

When ran, the spaces in the directory, sub directories, and file names should be removed.

Before

/300000 - 399999/310000 - 319999/310000 - 310999/310998 AB

After

/300000-399999/310000-319999/310000-310999/310998AB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment