Skip to content

Instantly share code, notes, and snippets.

@joduplessis
Created August 2, 2019 09:54
Show Gist options
  • Save joduplessis/72cbd33619e8596aae7fc9efdaf13b25 to your computer and use it in GitHub Desktop.
Save joduplessis/72cbd33619e8596aae7fc9efdaf13b25 to your computer and use it in GitHub Desktop.
Handy little script to rename files on MacOS (haven't tested on other *nix systems - but should work) in bulk.
#!/bin/bash
# Renames all SVG files & convert commas to underscores, etc
find . -type f -name "*.svg" -print0 | while IFS= read -r -d '' file; do
mv "$file" "$(echo $(echo "$file" | tr ',' '_' | tr -d ' '))"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment