BashbeginnercliAI generated

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

  1. 01

    Design the CLI argument interface

    ~1h

    Use getopts to accept a directory, a regex pattern, a replacement string, and a --dry-run flag.

  2. 02

    Build the file listing and matching logic

    ~1.5h

    Use find to list files and grep -P to test which filenames match the regex pattern.

  3. 03

    Implement the rename engine

    ~2h

    Use sed to transform matched filenames into new names and mv to apply the rename, guarding against collisions.

  4. 04

    Add dry-run preview output

    ~1h

    When --dry-run is set, print an old-name -> new-name table without touching the filesystem.

  5. 05

    Write a test suite with fixture files

    ~1.5h

    Create a set of sample files and assert renamed results match expectations using bats or plain assertions.

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~7h · 5 steps

Tech stack

sedgetoptsfind