Skip to content

Instantly share code, notes, and snippets.

@danielfleischer
Created April 4, 2018 09:01
Show Gist options
  • Save danielfleischer/ecce91bfbba226f0059f496d057674a3 to your computer and use it in GitHub Desktop.
Save danielfleischer/ecce91bfbba226f0059f496d057674a3 to your computer and use it in GitHub Desktop.
Rename your PDFs using nice capitalization, using the `rename` utility.
#!/usr/bin/env sh
rename -f -c *
find . -name "*.pdf" -exec rename -f -e 's/\b([a-z])/\u\L$1/g' {} \;
find . -name "*.Pdf" -exec rename -f -e 's/Pdf/pdf/' {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment