renamer

command module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2025 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

renamer

renamer is a batch file renaming tool

GoDev CI

Features
  • Simple
  • Statically compiled binaries
  • Regular expression match and replace
Install

Binaries

Releases Releases

Find the latest pre-compiled binaries here or download and install it now with curl https://i.jpillora.com/renamer! | bash

Source

$ go install -v github.com/jpillora/renamer@latest
Usage
$ renamer --help

  Usage: renamer [options] <rule> <target> [target] ...

  renamer is a regular-expression based batch file renaming tool

  <rule> should be in the form:

    <find>:<replace>           for plain text matching, or
    /<find>/<replace>/<flags>  for regular expression matching

    by default, <find> and <replace> only operates on the input
    file's basename (the last part of the file). this ensures
    files are *renamed* and not *moved*. if you'd like to operate
    on the full (absolute) path, you can enable the --fullpath flag.

    plain text matching only finds and replaces the first instance
    of <find>. if you need to replace all instances, use regular
    expression matching with the 'g' flag.

    regular expression matching uses the go regular expression
    engine (https://golang.org/pkg/regexp/). the format above uses
    slash / as the field separator, however any character may be
    used, as long it appears exactly 3 times. regular expression
    groups may also be used, and replaced back into the result
    using $N placeholders ($1 for the first group, $2 for second, etc).

    regular expression flags can be:
      i - enables case-insensitive matching
      g - enables global matching, instead of the
          default single-instance matching

  <target> must refer to an existing file or directory. by default
  a directory target will be renamed, however the --recursive flag
  will change this behaviour to recurse into directories and use the
  directory contents as more targets.

  Options:
  --recursive, -r  recurse into directories instead of renaming them
  --dryrun, -d     read-only mode for testing renames
  --fullpath, -f   find and replace against the targets full path
  --overwrite, -o  allow existing files to be overwritten
  --verbose, -v    enable verbose logs
  --limit, -l      rename limit tries to prevent you from renaming your
                   whole file system (default 1000)
  --version        display version
  --help, -h       display help

  Version:
    0.0.0-src

  Read more:
    github.com/jpillora/renamer

Credits

renamer in Node https://www.npmjs.com/package/renamer

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址