Last active
October 29, 2021 23:52
-
-
Save ziadoz/c226ce587bc11f60c16cd623afe50d7a to your computer and use it in GitHub Desktop.
Remove Special Characters From macOS Filenames
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
#!/usr/bin/env bash | |
# @see: https://superuser.com/questions/617517/remove-all-illegal-characters-from-all-filenames-in-a-given-folder | |
# The 's/[\:?\\]//g' regular expression removes ?, : and \ characters. | |
# Dry Run: | |
find "/path/to/files" -type f -exec rename -n 's/[\:?\\]//g' {} \; | |
# Execute: | |
find "/path/to/files" -type f -exec rename 's/[\:?\\]//g' {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment