MV(1) | General Commands Manual | MV(1) |
mv
— move and
rename files
mv |
[-f |-i |-n ]
[-v ] source
destfile |
mv |
[-f |-i |-n ]
[-v ] source...
destdir |
mv |
[-f |-i |-n ]
[-v ] -t
destdir source... |
In the first form, mv
moves each given
source to destfile. This form is
assumed when destfile does not refers to an existing
directory, or a symlink pointing to one. Additionally, in this case a
trailing slash and source not referring to a directory
results in an error.
In the second and third form, mv
moves
each given source into destdir
with appending the source basename to
destdir to create the full destination path.
-f
-i
and -n
options.-i
mv
to ask before overwriting a
file. Overrides previously set -f
and
-n
options.-n
-f
and -i
options.-t
destdir-v
The mv
utility exits 0 on success,
and >0 if an error occurs.
mv
should be compliant with the IEEE Std
1003.1-2024 (“POSIX.1”) specification.
The -n
, -t
destdir and -v
options are
extensions.
A mv
command appeared in
Version 1 AT&T UNIX.
2024-05-10 | Linux 6.6.67-gentoo-x86_64 |