Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mv(1) — CX/UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chmod(1)

cp(1)

cpio(1)

ln(1)

rm(1)

rename(2)

mv(1)

NAME

mv − move or rename files

SYNOPSIS

mv [ −f ] [ −i ] file target

mv [ −f ] [ −i ] file ... directory

DESCRIPTION

mv moves (changes the name of) file to target.

If target already exists, it is removed before file is moved.  If target has a mode which forbids writing, mv prints the mode (see chmod(2)) and reads the standard input to obtain a line; if the line begins with y, or the locale’s equivalent, the move takes place; if not, the file is not moved. 

In the second form, one or more files (plain files or directories) are moved to the directory with their original filenames. 

mv refuses to move a file onto itself. 

The following options are recognized:

−i stands for interactive mode.  mv will prompt for confirmation whenever the move would overwrite an existing target and reads a line from standard input.  A line beginning with a y, or the locale’s equivalent, means that the move should proceed.  Any other answer prevents mv from overwriting the target. 

−f stands for force.  mv will move the file(s) without prompting even if it is writing over an existing target.  This option overrides the −i option.  Note that this is the default if the standard input is not a terminal. 

If file is a file and target is a link to another file with links, the other links remain and target becomes a new file. 

SEE ALSO

chmod(1), cp(1), cpio(1), ln(1), rm(1). 
rename(2) in the CX/UX Programmer’s Reference Manual.

NOTES

If file and target lie on different file systems, mv must copy the file and delete the original.  In this case the owner name becomes that of the copying process and any linking relationship with other files is lost. 

CX/UX User’s Reference Manual

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026