GNU Info

Info Node: (fileutils.info)mv invocation

(fileutils.info)mv invocation


Next: rm invocation Prev: install invocation Up: Basic operations
Enter node , (file) or (file)node

`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 partion 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.  Note: Trailing slashes.

   The program accepts the following options.  Also see Note: Common
options.

`-b'
`--backup[=METHOD]'
     Note: Backup options.  Make a backup of each file that would
     otherwise be overwritten or removed.

`-f'
`--force'
     Do not prompt the user before removing an unwritable destination
     file.

`-i'
`--interactive'
     Prompt whether to overwrite each existing destination file,
     regardless of its permissions.  If the response does not begin
     with `y' or `Y', the file is skipped.

`-u'
`--update'
     Do not move a nondirectory that has an existing destination with
     the same or newer modification time.

`-v'
`--verbose'
     Print the name of each file before moving it.

`--strip-trailing-slashes'
     Remove any trailing slashes from each SOURCE argument.  Note:
     Trailing slashes.

`-S SUFFIX'
`--suffix=SUFFIX'
     Append SUFFIX to each backup file made with `-b'.  Note: Backup
     options.

`--target-directory=DIRECTORY'
     Specify the destination DIRECTORY.  Note: Target directory.

`-V METHOD'
`--version-control=METHOD'
     Change the type of backups made with `-b'.  The METHOD argument
     can be `none' (or `off'), `numbered' (or `t'), `existing' (or
     `nil'), or `never' (or `simple').  Note: Backup options.


automatically generated by info2www version 1.2.2.9