MV(1) General Commands Manual MV(1)

mvmove 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.

Force, do not ask before overwriting to the destination path. Overrides previously set -i and -n options.
Interactive, causes mv to ask before overwriting a file. Overrides previously set -f and -n options.
No-clobber, never overwrite. Overrides previously set -f and -i options.
destdir
Set the destination directory.
Verbose, write which action has been done.

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