Skip to content

Instantly share code, notes, and snippets.

@JoeDuncko
JoeDuncko / capitalizeFirstLetterOfEveryFileInThisDirectory.sh
Created October 25, 2021 01:07
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
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
</head>
<body>