Unix and Linux Discussions Tagged with move files |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
2 |
66,034 |
Shell Programming and Scripting |
|
|
|
7 |
104,162 |
Shell Programming and Scripting |
|
|
|
14 |
11,737 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
5,918 |
Shell Programming and Scripting |
|
|
|
6 |
6,896 |
Shell Programming and Scripting |
|
|
|
7 |
2,218 |
Shell Programming and Scripting |
|
|
|
7 |
14,512 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
4,268 |
UNIX for Dummies Questions & Answers |
|
|
|
7 |
5,607 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
15,569 |
Shell Programming and Scripting |
|
|
|
1 |
7,287 |
Shell Programming and Scripting |
|
|
|
0 |
2,856 |
AIX |
|
|
|
8 |
7,211 |
IP Networking |
|
|
|
8 |
44,904 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,501 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
2,477 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
4,847 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
2,553 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
3,230 |
UNIX for Dummies Questions & Answers |
mv(1) General Commands Manual mv(1)
Name
mv - move or rename files
Syntax
mv [-i] [-f] [-] file1 file2
mv [-i] [-f] [-] file... directory
Description
The command moves (changes the name of) file1 to file2.
If file2 already exists, it is removed before file1 is moved. If file2 has a mode which forbids writing, prints the mode and reads the
standard input to obtain a line. If the line begins with y, the move takes place. If it does not, exits. For further information, see
In the second form, one or more files (plain files or directories) are moved to the directory with their original file-names.
The command refuses to move a file onto itself.
Options
- Interprets all following arguments as file names to allow file names starting with a minus.
-f Force. This option overrides any mode restrictions or the -i switch.
-i Interactive mode. If a move is to supersede an existing file, the system prompts youw with the name of the file fol-
lowed by a question mark. If you type a string that begins with y, the move occurs. If you type any other response,
the move does not occur.
Restrictions
If file1 and file2 lie on different file systems, 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.
See Also
cp(1), ln(1)
mv(1)