A utility to batch-rename files, optionally through a VCS


sednames is a utility that uses sed(1) to transform input filenames, then renames those files either in the file-system only (using rename(2)) or in your version-control system.


% hg clone ReplaceAlphaWithMaskIU MixAlphaWithMaskIU
updating working directory
15 files updated, 0 files merged, 0 files removed, 0 files unresolved
% cd MixAlphaWithMaskIU
% sednames -e 's/Replace/Mix/' --vcs=hg *Replace*
hg mv ReplaceAlphaWithMask.xcodeproj MixAlphaWithMask.xcodeproj
moving ReplaceAlphaWithMask.xcodeproj/project.pbxproj to MixAlphaWithMask.xcodeproj/project.pbxproj
hg mv ReplaceAlphaWithMaskFilter.h MixAlphaWithMaskFilter.h
hg mv ReplaceAlphaWithMaskFilter.m MixAlphaWithMaskFilter.m
hg mv ReplaceAlphaWithMaskFilterKernel.cikernel MixAlphaWithMaskFilterKernel.cikernel
hg mv ReplaceAlphaWithMaskPlugInLoader.h MixAlphaWithMaskPlugInLoader.h
hg mv ReplaceAlphaWithMaskPlugInLoader.m MixAlphaWithMaskPlugInLoader.m

You can use any VCS that has a “mv” subcommand, including svn, hg, bzr, and git. You can even use any other external program by using --custom-rename instead of --vcs (see the --help output for more information).

A release will probably come soon. In the meantime, you can download the current revision from the Mercurial repository, or clone the Mercurial repository itself.

Mercurial repository

If you want to contribute bug-fixes or enhancements to sednames, the easiest way to do that is to clone the Mercurial repository for sednames. To do this, type this command into a terminal:

hg clone sednames

I provide sednames—the program, and its source code—under a three-clause BSD license. For more information, see the file named LICENSE.txt that comes with it.

Valid XHTML 1.0! Valid CSS!