Skip to content

fbergen/rename

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rename

Usage: rename [options] files... expression

rename is a utility for renaming multiple files, rename takes the list of files to rename and a search/replace pattern as the last argument.

If no filenames are given, filenames will be read from stdin.

It's similar to Unix rename and Perl Rename written in Go.

Examples

Backup files, add ".bak" to all files: rename path/to/files/* 's/$/.bak//'

Backup files, add ".bak" to all files (keeping the original): rename path/to/files/* 's/$/.bak//' -c

Remove (last) extension: rename path/to/files/* 's/\.[a-z]+$//'

Swap double extensions : rename path/to/files/* 's/([a-z]+)\.([a-z]+)$/$2.$1/'

Installation

Homebrew

brew install fbergen/tap/rename

Options

-c, --copy=false: Copy instead of move.
-f, --force=false: Overwrite existing files.
-h, --help=false: Show help dialog.
-i, --interactive=false: Ask for confirmation, before renaming
-n, --no-action=false: Don't perform any changes. Show what files would have been renamed.
-v, --verbose=false: Show which files where renamed, if any.

About

Unix rename written in Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages