Small utility to fix my recurring pain of capital and uppercase folders. Nothing fancy.
gcase is a CLI tool for bulk-renaming files and directories by changing their case. Point it at a path, pick a mode, and it renames everything with full control over recursion, hidden files, extension preservation, and dry-run previews before touching anything.
- Rename files, directories, or both in one shot
- Recursive mode for entire directory trees
- Dry-run preview to see every change before it happens
- Preserve file extensions during rename (e.g.
FILE.TXT→file.TXT) - Hidden file support (
.dotfilesand.dotdirs) - Deepest paths renamed first safe order guaranteed, no stale parent paths
- Works on Linux, macOS, and Windows
go install github.com/shricodev/gcase@latestgcase <command> <path> [flags]
| Command | Description |
|---|---|
lower |
Rename items to lowercase |
upper |
Rename items to uppercase |
capitalize |
Capitalize the first letter of each item name |
| Flag | Short | Default | Description |
|---|---|---|---|
--dry-run |
-n |
false |
Show what would be renamed without changing anything |
--recursive |
-r |
false |
Rename recursively |
--target |
dirs |
What to rename: dirs, files, or all |
|
--preserve-extension |
true |
Preserve file extensions when renaming | |
--include-hidden |
false |
Include hidden files and directories |
Preview lowercasing all files recursively, without changing anything:
gcase lower ./myproject --target files --recursive --dry-runUppercase all directory names in the current folder:
gcase upper . --target dirsCapitalize everything recursively, including hidden files:
gcase capitalize ./myproject --target all --recursive --include-hiddenLowercase file names but keep their extensions untouched:
gcase lower ./myproject --target files --preserve-extensionRename a single file:
gcase upper ./docs/README.mdFull recursive rename of files and dirs, live (no dry-run):
gcase lower ./myproject --target all --recursive --include-hidden --preserve-extension=falseLicensed under the Apache 2.0 License.
