MPE/iX Shell and Utilities Reference Manual, Vol 1

mv(1) MPE/iX Shell and Utilities mv(1)
NAME
mv — rename and move files and directories
SYNOPSIS
mv [–fi] file1 file2
mv [–fi] file ... directory
mv –R–r [–fi] directory1 directory2
DESCRIPTION
mv renames files or moves them to a different directory. If you specify multiple files, the tar-
get (that is, the last path name on the command line) must be a directory. mv moves the files
into that directory and gives them names that match the final components of the source path
names. When you specify a single source file and the target is not a directory, mv moves the
source to the new name, by a simple rename if possible.
If a destination file exists for which you do not have write permission, mv prompts with the
name of the existing file. If you answer y or yes, it deletes the destination and then moves
the source.
Options
mv accepts the following options:
–f does not ask if you want to overwrite an existing destination without write permis-
sion; it automatically behaves as if you answered yes. If you specify both –f and
–i, mv uses the option which appears last on the command line.
–i always prompts before overwriting an existing file, whether or not the file is read-
only. If you specify both –f and –i, mv uses the option which appears last on the
command line.
–R moves a directory and all its contents (files, subdirectories, files in subdirectories, and
so on). For example,
mv -R dir1 dir2
moves the entire contents of dir1 to dir2/dir1. mv creates any directories that it
needs.
–r is equivalent to –R.
1-386 Commands and Utilities