1 .\" Written by Andries E. Brouwer (aeb@cwi.nl)
2 .\" Placed in the public domain
4 .TH RENAME 1 "June 2011" "util-linux" "User Commands"
10 .IR "expression replacement file" ...
13 will rename the specified files by replacing the first occurrence of
19 .BR \-s , " \-\-symlink"
20 Do not rename a symlink but its target.
22 .BR \-v , " \-\-verbose"
23 Show which files where renamed, if any.
25 .BR \-n , " \-\-no\-act"
26 Do not make any changes.
28 .BR \-o , " \-\-no\-overwrite"
29 Do not overwrite existing files.
31 .BR \-V , " \-\-version"
32 Display version information and exit.
35 Display help text and exit.
38 .IR foo1 ", ..., " foo9 ", " foo10 ", ..., " foo278 ,
49 .IR foo001 ", ..., " foo009 ", " foo010 ", ..., " foo278 .
54 rename .htm .html *.htm
58 will fix the extension of your html files.
59 Provide an empty string for shortening:
63 rename '_with_long_name' '' file_with_long_name.*
67 will remove the substring in the filenames.
69 The renaming has no safeguards except the
71 option. If the user has
72 permission to rewrite file names, the command will perform the action without
73 any questions. For example, the result can be quite drastic when the command
74 is run as root in the /lib directory. Always make a backup before running the
75 command, unless you truly know what you are doing.
81 all requested rename operations were successful
84 all rename operations failed
87 some rename operations failed
93 unanticipated error occurred
99 The rename command is part of the util-linux package and is available from
100 https://www.kernel.org/pub/linux/utils/util-linux/.