mv
Linux Commands - Managing Files and Text

mv

This command moves or renames files. Now it may seem strange that mv would be used to rename files; however, because the process of renaming a file or directory requires the same update for the directory as a move mv was used.


Example:

mv mytext /home/fred


The file mytext is moved to the /home/fred directory and is given the name mytext.


Options

-b create backup before moving

-f remove existing destination files without asking

-i prompt before overwriting destination files

-S set a new suffix

-u don't move a file to an existing location with same

or newer file

When you use the -f option you will not have answer any questions when the process begins. The -i option is just the opposite in that it is an interactive option so that you will be asked for each process of moving a file or directory.