File: mv.1

package info (click to toggle)
coreutils 9.10-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 70,560 kB
  • sloc: ansic: 253,546; sh: 30,931; perl: 8,141; yacc: 1,846; makefile: 198; python: 47; sed: 16
file content (125 lines) | stat: -rw-r--r-- 5,534 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.50.1.
.TH MV "1" "February 2026" "GNU coreutils 9.10" "User Commands"
.SH NAME
mv \- move (rename) files
.SH SYNOPSIS
.B mv
[\fI\,OPTION\/\fR]... [\fI\,-T\/\fR] \fI\,SOURCE DEST\/\fR
.br
.B mv
[\fI\,OPTION\/\fR]... \fI\,SOURCE\/\fR... \fI\,DIRECTORY\/\fR
.br
.B mv
[\fI\,OPTION\/\fR]... \fI\,-t DIRECTORY SOURCE\/\fR...
.SH DESCRIPTION
.\" Add any additional description here
.PP
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
.PP
Mandatory arguments to long options are mandatory for short options too.
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv--backup'\fB\-\-backup[=CONTROL]\fP\X'tty: link'
make a backup of each existing destination file
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv-b'\fB\-b\fP\X'tty: link'
like \fB\-\-backup\fR but does not accept an argument
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv--debug'\fB\-\-debug\fP\X'tty: link'
explain how a file is copied.  Implies \fB\-v\fR
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv--exchange'\fB\-\-exchange\fP\X'tty: link'
exchange source and destination
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv-f'\fB\-f, \-\-force\fP\X'tty: link'
do not prompt before overwriting
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv-i'\fB\-i, \-\-interactive\fP\X'tty: link'
prompt before overwrite
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv-n'\fB\-n, \-\-no\-clobber\fP\X'tty: link'
do not overwrite an existing file
.PP
If you specify more than one of \fB\-i\fR, \fB\-f\fR, \fB\-n\fR, only the final one takes effect.
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv--no-copy'\fB\-\-no\-copy\fP\X'tty: link'
do not copy if renaming fails
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv--strip-trailing-slashes'\fB\-\-strip\-trailing\-slashes\fP\X'tty: link'
remove any trailing slashes from each SOURCE argument
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv-S'\fB\-S, \-\-suffix=\,SUFFIX\fP\X'tty: link'\/\fR
override the usual backup suffix
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv-t'\fB\-t, \-\-target\-directory=\,DIRECTORY\fP\X'tty: link'\/\fR
move all SOURCE arguments into DIRECTORY
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv-T'\fB\-T, \-\-no\-target\-directory\fP\X'tty: link'
treat DEST as a normal file
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv--update'\fB\-\-update[=UPDATE]\fP\X'tty: link'
control which existing files are updated;
UPDATE={all,none,none\-fail,older(default)}
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv-u'\fB\-u\fP\X'tty: link'
equivalent to \fB\-\-update\fR[=\fI\,older\/\fR].  See below
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv-v'\fB\-v, \-\-verbose\fP\X'tty: link'
explain what is being done
.TP
\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#mv-Z'\fB\-Z, \-\-context\fP\X'tty: link'
set SELinux security context of destination file to default type
.TP
\X'tty: link https://www.gnu.org/software/coreutils/mv#mv--help'\fB\-\-help\fP\X'tty: link'
display this help and exit
.TP
\X'tty: link https://www.gnu.org/software/coreutils/mv#mv--version'\fB\-\-version\fP\X'tty: link'
output version information and exit
.PP
UPDATE controls which existing files in the destination are replaced.
\&'all' is the default operation when an \fB\-\-update\fR option is not specified,
and results in all existing files in the destination being replaced.
\&'none' is like the \fB\-\-no\-clobber\fR option, in that no files in the
destination are replaced, and skipped files do not induce a failure.
\&'none\-fail' also ensures no files are replaced in the destination,
but any skipped files are diagnosed and induce a failure.
\&'older' is the default operation when \fB\-\-update\fR is specified, and results
in files being replaced if they're older than the corresponding source file.
.PP
The backup suffix is '~', unless set with \fB\-\-suffix\fR or SIMPLE_BACKUP_SUFFIX.
The version control method may be selected via the \fB\-\-backup\fR option or through
the VERSION_CONTROL environment variable.  Here are the values:
.TP
none, off
never make backups (even if \fB\-\-backup\fR is given)
.TP
numbered, t
make numbered backups
.TP
existing, nil
numbered if numbered backups exist, simple otherwise
.TP
simple, never
always make simple backups
.SH AUTHOR
Written by Mike Parker, David MacKenzie, and Jim Meyering.
.SH "REPORTING BUGS"
Report bugs to: bug\-coreutils@gnu.org
.br
GNU coreutils home page: <https://www.gnu.org/software/coreutils/>
.br
General help using GNU software: <https://www.gnu.org/gethelp/>
.br
Report any translation bugs to <https://translationproject.org/team/>
.SH COPYRIGHT
Copyright \(co 2026 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
\fBrename\fP(2)
.PP
.br
Full documentation <https://www.gnu.org/software/coreutils/mv>
.br
or available locally via: info \(aq(coreutils) mv invocation\(aq