Massren for fast file renaming

Go back to the blog or to all shorts.

My tool of choice for bulk file-renaming has become1 Massren:

Massren is a command line tool that can be used to rename multiple files using your own text editor. Multiple-rename tools are usually difficult to use from the command line since any regular expression needs to be escaped, and each tool uses its own syntax and flavor of regex. The advantage of massren is that you are using the text editor you use every day, and so you can use all the features you are already used to.

Simply navigate to the directory in which your files are and invoke massren. You can easily set it up to use your favorite text editor, so for example, I have mine configured to use VSCode:

massren --config editor code

If you have a text editor you are comfortable with, then this can lead to all kinds of interesting possibilities, especially when combined with regular expression search.

Using Massren, VS Code, and regex for bulk file renaming.

This workflow is especially convenient in combination with an Alfred wokflow to open the current Finder directory in the terminal, such as this one.

  1. As opposed to, say, GUI clients for bulk-file renaming, although they are handy too. Icon
Icon