Skip to content

Instantly share code, notes, and snippets.

Last active Oct 29, 2021
What would you like to do?
Remove Special Characters From macOS Filenames
#!/usr/bin/env bash
# @see:
# 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