Saturday, July 17, 2010

mv Command

Renames or moves a file from one directory to another directory.

Syntax

mv [-f] [-i] oldname newname

-fmv will move the file(s) without prompting even if it is writing over an existing target. Note that this is the default if the standard input is not a terminal.
-iPrompts before overwriting another file.
oldnameThe oldname of the file renaming.
newnameThe newname of the file renaming.
filenameThe name of the file you want to move directory - The directory of were you want the file to go.

Examples

mv test.cpp newdir/

moves the file test.cpp to the directory newdir.

mv test.txt ../

moves the file test.txt back one directory (only if directory available).

No comments:

Post a Comment