UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: msgfmtChapter 2
Unix Commands
Next: Reference: native2ascii
 

mv

mv [options] sources target

Basic command to move files and directories around on the system or to rename them. mv works as the following table shows.

SourceTargetResult
Filename

Rename file as name.

FileExisting file

Overwrite existing file with source file.

SourceTargetResult
Directoryname

Rename directory as name.

DirectoryExisting directory

Move directory to be a subdirectory of existing directory.

One or more filesExisting directory

Move files to directory.

Options

--

Use this when one of the names begins with a -. For compatibility with old programs, a plain - also works.

-f

Force the move, even if target file exists; suppress messages about restricted access modes.

-i

Inquire; prompt for a y (yes) response before overwriting an existing target.


Previous: Reference: msgfmtUNIX in a Nutshell: System V EditionNext: Reference: native2ascii
Reference: msgfmtBook IndexReference: native2ascii

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System