[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
mv
: Move (rename) files
mv
moves or renames files (or directories). Synopsis:
mv [option]... source dest mv [option]... source... directory |
If the last argument names an existing directory, mv
moves each
other given file into a file with the same name in that directory.
Otherwise, if only two files are given, it renames the first as
the second. It is an error if the last argument is not a directory
and more than two files are given.
mv
can move any type of file from one filesystem to another.
Prior to version 4.0
of the fileutils,
mv
could move only regular files between filesystems.
For example, now mv
can move an entire directory hierarchy
including special device files from one partition to another. It first
uses some of the same code that's used by cp -a
to copy the
requested directories and files, then (assuming the copy succeeded)
it removes the originals. If the copy fails, then the part that was
copied to the destination partition is removed. If you were to copy
three directories from one partition to another and the copy of the first
directory succeeded, but the second didn't, the first would be left on
the destination partition and the second and third would be left on the
original partition.
If a destination file exists but is normally unwritable, standard input
is a terminal, and the `-f' or `--force' option is not given,
mv
prompts the user for whether to replace the file. (You might
own the file, or have write permission on its directory.) If the
response does not begin with `y' or `Y', the file is skipped.
Warning: If you try to move a symlink that points to a directory,
and you specify the symlink with a trailing slash, then mv
doesn't move the symlink but instead moves the directory referenced
by the symlink. See section 2.4 Trailing slashes.
The program accepts the following options. Also see 2. Common options.
mv
act as if `no' were
given as a response to every prompt about a destination file.
Specify `--reply=query' to make mv
prompt the user
about each existing destination file.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |