Want to take your software engineering career to the next level? Join the mailing list for career tips & advice Click here


Simple batch renaming script (ruby)

Subscribe to updates I use mvmv

Statistics on mvmv

Number of watchers on Github 26
Number of open issues 0
Main language Ruby
Open pull requests 0+
Closed pull requests 0+
Last commit almost 8 years ago
Repo Created about 8 years ago
Repo Last Updated over 3 years ago
Size 101 KB
Organization / Authorjunegunn
Page Updated
Do you use mvmv? Leave a review!
View mvmv activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Evaluating mvmv for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)


Simple batch renaming script.


$ gem install mvmv


usage:    mvmv [OPTIONS] <command> [<args>] <files>

          mvmv prefix       <prefix>     <files>
          mvmv suffix       <suffix>     <files>
          mvmv name         <name>       <files>
          mvmv name-suffix  <suffix>     <files>
          mvmv ext          <.extension> <files>
          mvmv upper                     <files>
          mvmv lower                     <files>

          mvmv regexp       <from> <to>  <files>
          mvmv regexpi      <from> <to>  <files>
          mvmv name-regexp  <from> <to>  <files>
          mvmv name-regexpi <from> <to>  <files>

          -f, --force       Force rename
              --no-color    Disable ANSI color codes


Adding simple prefix and suffix to files

mvmv prefix old_ *.txt
mvmv suffix .bak *.txt

Numbering files

You can attach sequence numbers to files with a series of #s. Depending on the number of #s, numbers will be padded with zeros.

mvmv name Photo#### *.jpg *.gif *.png
mvmv name-suffix -## *.jpg

Advanced renaming with regular expressions

regexp command performs regular expression substitutions. (regexpi is the case-insensitive version.) name-regexp command performs regular expression subsitution only on the name parts of the given files.

mvmv name-regexp '^(.*)_-_(.*)$' '\2 - \1' *.mp3
mvmv list of languages used
Other projects in Ruby