Bulk File Renamer with Regex Patterns
A command-line tool that batch-renames files in a directory using user-supplied regex find/replace patterns, with a dry-run preview mode before committing changes. Learners practice sed/regex usage, argument parsing with getopts, and safe file operations.
- Estimate
- ~7h
- Steps
- 5
- Completed by
- 0
- Proposed by
- codeseed.app
sed · getopts · find
Project roadmap
- 01
Design the CLI argument interface
~1hUse getopts to accept a directory, a regex pattern, a replacement string, and a --dry-run flag.
- 02
Build the file listing and matching logic
~1.5hUse find to list files and grep -P to test which filenames match the regex pattern.
- 03
Implement the rename engine
~2hUse sed to transform matched filenames into new names and mv to apply the rename, guarding against collisions.
- 04
Add dry-run preview output
~1hWhen --dry-run is set, print an old-name -> new-name table without touching the filesystem.
- 05
Write a test suite with fixture files
~1.5hCreate a set of sample files and assert renamed results match expectations using bats or plain assertions.
Resources
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack