]> git.ipfire.org Git - thirdparty/util-linux.git/blame - misc-utils/rename.1
docs: don't use bold or italics for "[option]" in synopsis of man pages
[thirdparty/util-linux.git] / misc-utils / rename.1
CommitLineData
eb63b9b8
KZ
1.\" Written by Andries E. Brouwer (aeb@cwi.nl)
2.\" Placed in the public domain
3.\"
232dc924 4.TH RENAME 1 "June 2011" "util-linux" "User Commands"
eb63b9b8 5.SH NAME
0791a058 6rename \- rename files
eb63b9b8 7.SH SYNOPSIS
f736d385 8.B rename
f49ccec2
BS
9[options]
10.IR "expression replacement file" ...
eb63b9b8
KZ
11.SH DESCRIPTION
12.B rename
13will rename the specified files by replacing the first occurrence of
03b3d715 14.I expression
eb63b9b8 15in their name by
03b3d715
SK
16.IR replacement .
17.SH OPTIONS
2a45745f 18.TP
03b3d715
SK
19\fB\-v\fR, \fB\-\-verbose\fR
20Give visual feedback which files where renamed, if any.
21.TP
22\fB\-V\fR, \fB\-\-version\fR
2a45745f 23Display version information and exit.
03b3d715 24.TP
5a2a8177
JM
25\fB\-s\fR, \fB\-\-symlink\fR
26Peform rename on symlink target
27.TP
03b3d715 28\fB\-h\fR, \fB\-\-help\fR
449a215f 29Display help text and exit.
0791a058
BS
30.SH EXAMPLES
31Given the files
eb63b9b8
KZ
32.IR foo1 ", ..., " foo9 ", " foo10 ", ..., " foo278 ,
33the commands
eb63b9b8 34.RS
03b3d715 35.PP
eb63b9b8
KZ
36.nf
37rename foo foo0 foo?
38rename foo foo0 foo??
39.fi
03b3d715 40.PP
eb63b9b8 41.RE
eb63b9b8
KZ
42will turn them into
43.IR foo001 ", ..., " foo009 ", " foo010 ", ..., " foo278 .
eb63b9b8
KZ
44And
45.RS
03b3d715 46.PP
eb63b9b8
KZ
47.nf
48rename .htm .html *.htm
49.fi
03b3d715 50.PP
eb63b9b8 51.RE
eb63b9b8 52will fix the extension of your html files.
03b3d715 53.SH WARNING
449a215f
BS
54The renaming has no safeguards. If the user has permission to rewrite file names,
55the command will perform the action without any questions. For example, the
56result can be quite drastic when the command is run as root in the /lib
57directory. Always make a backup before running the command, unless you truly
03b3d715 58know what you are doing.
d6cf9e16
SK
59.SH "EXIT STATUS"
60.RS
61.PD 0
62.TP
63.B 0
64all requested rename operations were successful
65.TP
66.B 1
67all rename operations failed
68.TP
69.B 2
70some rename operations failed
71.TP
72.B 4
73nothing was renamed
74.TP
75.B 64
76unanticipated error occurred
77.PD
78.RE
eb63b9b8
KZ
79.SH "SEE ALSO"
80.BR mv (1)
86d62711 81.SH AVAILABILITY
601d12fb
KZ
82The rename command is part of the util-linux package and is available from
83ftp://ftp.kernel.org/pub/linux/utils/util-linux/.