2006-12-06 17:25:41 -06:00
|
|
|
.\" Written by Andries E. Brouwer (aeb@cwi.nl)
|
|
|
|
.\" Placed in the public domain
|
|
|
|
.\"
|
2011-08-18 15:18:34 -05:00
|
|
|
.TH RENAME 1 "June 2011" "util-linux" "User Commands"
|
2006-12-06 17:25:41 -06:00
|
|
|
.SH NAME
|
2011-02-27 09:28:14 -06:00
|
|
|
rename \- rename files
|
2006-12-06 17:25:41 -06:00
|
|
|
.SH SYNOPSIS
|
2009-07-22 04:29:04 -05:00
|
|
|
.B rename
|
2011-08-28 04:14:42 -05:00
|
|
|
.RI [ options ] " expression replacement file" ...
|
2006-12-06 17:25:41 -06:00
|
|
|
.SH DESCRIPTION
|
|
|
|
.B rename
|
|
|
|
will rename the specified files by replacing the first occurrence of
|
2011-06-11 16:42:45 -05:00
|
|
|
.I expression
|
2006-12-06 17:25:41 -06:00
|
|
|
in their name by
|
2011-06-11 16:42:45 -05:00
|
|
|
.IR replacement .
|
|
|
|
.SH OPTIONS
|
2007-09-04 02:33:36 -05:00
|
|
|
.TP
|
2011-06-11 16:42:45 -05:00
|
|
|
\fB\-v\fR, \fB\-\-verbose\fR
|
|
|
|
Give visual feedback which files where renamed, if any.
|
|
|
|
.TP
|
|
|
|
\fB\-V\fR, \fB\-\-version\fR
|
2007-09-04 02:33:36 -05:00
|
|
|
Display version information and exit.
|
2011-06-11 16:42:45 -05:00
|
|
|
.TP
|
2012-11-26 09:50:08 -06:00
|
|
|
\fB\-s\fR, \fB\-\-symlink\fR
|
|
|
|
Peform rename on symlink target
|
|
|
|
.TP
|
2011-06-11 16:42:45 -05:00
|
|
|
\fB\-h\fR, \fB\-\-help\fR
|
2011-08-28 04:14:42 -05:00
|
|
|
Display help text and exit.
|
2011-02-27 09:28:14 -06:00
|
|
|
.SH EXAMPLES
|
|
|
|
Given the files
|
2006-12-06 17:25:41 -06:00
|
|
|
.IR foo1 ", ..., " foo9 ", " foo10 ", ..., " foo278 ,
|
|
|
|
the commands
|
|
|
|
.RS
|
2011-06-11 16:42:45 -05:00
|
|
|
.PP
|
2006-12-06 17:25:41 -06:00
|
|
|
.nf
|
|
|
|
rename foo foo0 foo?
|
|
|
|
rename foo foo0 foo??
|
|
|
|
.fi
|
2011-06-11 16:42:45 -05:00
|
|
|
.PP
|
2006-12-06 17:25:41 -06:00
|
|
|
.RE
|
|
|
|
will turn them into
|
|
|
|
.IR foo001 ", ..., " foo009 ", " foo010 ", ..., " foo278 .
|
|
|
|
And
|
|
|
|
.RS
|
2011-06-11 16:42:45 -05:00
|
|
|
.PP
|
2006-12-06 17:25:41 -06:00
|
|
|
.nf
|
|
|
|
rename .htm .html *.htm
|
|
|
|
.fi
|
2011-06-11 16:42:45 -05:00
|
|
|
.PP
|
2006-12-06 17:25:41 -06:00
|
|
|
.RE
|
|
|
|
will fix the extension of your html files.
|
2011-06-11 16:42:45 -05:00
|
|
|
.SH WARNING
|
2011-08-28 04:14:42 -05:00
|
|
|
The renaming has no safeguards. If the user has permission to rewrite file names,
|
|
|
|
the command will perform the action without any questions. For example, the
|
|
|
|
result can be quite drastic when the command is run as root in the /lib
|
|
|
|
directory. Always make a backup before running the command, unless you truly
|
2011-06-11 16:42:45 -05:00
|
|
|
know what you are doing.
|
2006-12-06 17:25:41 -06:00
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR mv (1)
|
2007-07-02 18:17:04 -05:00
|
|
|
.SH AVAILABILITY
|
2010-11-30 04:41:59 -06:00
|
|
|
The rename command is part of the util-linux package and is available from
|
|
|
|
ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
|