See the “Target Directory” chapter in the GNU Coreutils manual:
-T
--no-target-directory
Do not treat the last operand specially when it is a directory or a symbolic link to a directory. This can help avoid race conditions in programs that operate in a shared area. For example, when the command
mv /tmp/source /tmp/dest
succeeds, there is no guarantee that/tmp/source
was renamed to/tmp/dest
: it could have been renamed to/tmp/dest/source
instead, if some other process created/tmp/dest
as a directory. However, ifmv -T /tmp/source /tmp/dest
succeeds, there is no question that/tmp/source
was renamed to/tmp/dest
.In the opposite situation, where you want the last operand to be treated as a directory and want a diagnostic otherwise, you can use the
--target-directory
(-t
) option.
Note that the GNU project does not consider man pages as a primary form of documentation; you should always look at the corresponding info
page (the note about this is put at the end of each man page for a program which is developed as part of the GNU project).