Skip to content
Move multiple files
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd
mmv
.gitignore
LICENSE
README.md
go.mod
go.sum
main.go

README.md

mmv

Move multiple files

mmv lets you move or rename one or more files at once, by editing their paths in your favourite text editor

API

$ mmv -h
mmv lets you rename multiple files at once, by editing their paths in your text editor

Usage:
  mmv [directory] [flags]

Flags:
      --dry-run           Print out the the changes without actually making them
      --excludes string   Exclude files which match this regular expression
  -h, --help              help for mmv
      --includes string   Only include files which match this regular expression

Example

$ mmv ./mydir

This will open the contents of the mydir in the text editor pointed to by 1) the $VISUAL environment variable, 2) the $EDITOR variable, or vim if neither are set.

You can then edit the filenames in your editor. When you save and exit, mmv will rename each file.

mmv is useful for complex renaming tasks, such as:

  • Using your text editor's powerful search/replace to edit filenames
  • Replacing spaces in filenames with underscores or dashes
  • Adding or removing a common substring from multiple filenames
You can’t perform that action at this time.