I understand if I mv foo.file boo.file
, I just rename foo.file to boo.file, and if I mv dir1/foo.file dir2/boo.file
, I delete dir1/foo.file and make a copy of that to dir2 and rename it as boo.file. But I was looking at the man page here:
NAME
mv -- move files
SYNOPSIS
mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
DESCRIPTION
In its first form, the mv utility renames the file named by the source
operand to the destination path named by the target operand. This form
is assumed when the last operand does not name an already existing direc-
tory.
In its second form, mv moves each file named by a source operand to a
destination file in the existing directory named by the directory oper-
and. The destination path for each operand is the pathname produced by
the concatenation of the last operand, a slash, and the final pathname
component of the named file.
I have 2 questions:
1. I know that "..." means repeatable argument, so what if I do mv dir1/foo.file dir2/boo.file dir3/woo.file
, what happens?
2. I don't quite get the second paragraph about the second form about "The destination path for each operand is the pathname produced by the concatenation of the last operand, a slash, and the final pathname component of the named file.
", what does "for each operand" and "the concatenation of the last operand, a slash, and the final pathname component of the named file" means?
Sorry I know they are silly questions