| rename.td - rename multiple files by a Perl expression |
rename.td - rename multiple files by a Perl expression
rename.td [ -v[v] ] [ -n ] [ -f ] perlexpr [ files ]
cat files.list | rename.td [ -v[v] ] [ -n ] [ -f ] perlexpr
rename.td renames the files supplied according to the rule specified as the first argument.
The perlexpr argument is a Perl expression which is expected to modify the $_
string in Perl for at least some of the filenames specified.
If a given filename is not modified by the expression, it will not be renamed.
If no filenames are given on the command line, filenames will be read via standard input.
For example, to rename all files matching *.bak to strip the extension,
you might say
rename.td 's/\.bak$//' *.bak
To translate uppercase names to lower, you'd use
rename.td 'y/A-Z/a-z/' *
Verbose: print names of files successfully renamed.
Verbose extra: print names of files of which name is not changed.
No Action: show what files would have been renamed, or skipped.
Force: overwrite existing files.
Create missing directories.
Output Tab-delimited fields line-by-line. First line is the headers. Each subsequent line describes a file in this way:
Zero when all rename succeeded, otherwise the highest error number of all the failed renames, if any.
See rename(2) for these error numbers.
No environment variables are used.
Larry Wall (author of the original)
Robin Barker
mv(1), perl(1), rename(2), file-rename(1p) (prename(1)), rename.ul (rename(1)), renamemanual(1)
If you give an invalid Perl expression you'll get a syntax error.
| rename.td - rename multiple files by a Perl expression |