Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoeDuncko/ed388c59c0fdf21b5b36c3997dfd67bb to your computer and use it in GitHub Desktop.
Save JoeDuncko/ed388c59c0fdf21b5b36c3997dfd67bb to your computer and use it in GitHub Desktop.
Capitalize first letter of every file in this directory macOS zsh
# Reanme the files to start with a capital letter and end with a 2,
# see https://stackoverflow.com/questions/3011625/git-mv-and-only-change-case-of-directory
for f in *; do git mv --force "./$f" "./${(C)f[1]}${f[2,-1]}2"; done
# Remove the 2
for f in *; do git mv --force "./$f" "./${f%?}"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment