@end macro
@macro optTargetDirectory
+@item -t @var{directory}
@itemx @w{@kbd{--target-directory}=@var{directory}}
+@opindex -t
@opindex --target-directory
@cindex target directory
@cindex destination directory
@end macro
@macro optNoTargetDirectory
-@item --no-target-directory
+@item -T
+@itemx --no-target-directory
+@opindex -T
@opindex --no-target-directory
@cindex target directory
@cindex destination directory
* Exit status:: Indicating program success or failure.
* Backup options:: -b -S -V, in some programs.
* Block size:: BLOCK_SIZE and --block-size, in some programs.
-* Target directory:: --target-directory, in some programs.
+* Target directory:: Specifying a target directory, in some programs.
* Trailing slashes:: --strip-trailing-slashes, in some programs.
* Traversing symlinks:: -H, -L, or -P, in some programs.
* Treating / specially:: --preserve-root and --no-preserve-root.
@table @samp
-@item --no-target-directory
+@item -T
+@itemx --no-target-directory
@opindex --no-target-directory
@cindex target directory
@cindex destination directory
@file{/tmp/source} was renamed to @file{/tmp/dest}: it could have been
renamed to @file{/tmp/dest/source} instead, if some other process
created @file{/tmp/dest} as a directory. However, if @file{mv
---no-target-directory /tmp/source /tmp/dest} succeeds, there is no
+-T /tmp/source /tmp/dest} succeeds, there is no
question that @file{/tmp/source} was renamed to @file{/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 @option{--target-directory} option instead.
+the @option{--target-directory} (@option{-t}) option.
+@item -t @var{directory}
@itemx @w{@kbd{--target-directory}=@var{directory}}
@opindex --target-directory
@cindex target directory
shell command, but that requires more human labor and brain power than
it should.)
-The @w{@kbd{--target-directory}} option allows the @command{cp},
+The @w{@kbd{--target-directory}} (@option{-t}) option allows the @command{cp},
@command{install}, @command{ln}, and @command{mv} programs to be used
conveniently with @command{xargs}. For example, you can move the files
from the current directory to a sibling directory, @code{d} like this:
@smallexample
-ls | xargs mv --target-directory=../d --
+ls | xargs mv -t ../d --
@end smallexample
However, this doesn't move files whose names begin with @samp{.}.
@example
find . -mindepth 1 -maxdepth 1 \
- | xargs mv --target-directory=../d
+ | xargs mv -t ../d
@end example
But both of the above approaches fail if there are no files in the
@example
find . -mindepth 1 -maxdepth 1 -print0 \
| xargs --null --no-run-if-empty \
- mv --target-directory=../d
+ mv -t ../d
@end example
@end table
@noindent
-The @option{--target-directory} and @option{--no-target-directory}
+The @option{--target-directory} (@option{-t}) and
+@option{--no-target-directory} (@option{-T})
options cannot be combined.
@node Trailing slashes
@command{cp} copies files (or, optionally, directories). The copy is
completely independent of the original. You can either copy one file to
another, or copy arbitrarily many files to a destination directory.
-Synopsis:
+Synopses:
@example
-cp [@var{option}]@dots{} @var{source} @var{dest}
+cp [@var{option}]@dots{} [-T] @var{source} @var{dest}
cp [@var{option}]@dots{} @var{source}@dots{} @var{directory}
+cp [@var{option}]@dots{} -t @var{directory} @var{source}@dots{}
@end example
-If the last argument names an existing directory, @command{cp} copies each
-@var{source} file into that directory (retaining the same name).
-Otherwise, if only two files are given, it copies the first onto the
-second. It is an error if the last argument is not a directory and more
-than two non-option arguments are given.
+@itemize @bullet
+@item
+If two file names are given, @command{cp} copies the first file to the
+second.
+
+@item
+If the @option{--target-directory} (@option{-t}) option is given, or
+failing that if the last file is a directory and the
+@option{--no-target-directory} (@option{-T}) option is not given,
+@command{cp} copies each @var{source} file to the specified directory,
+using the @var{source}s' names.
+@end itemize
Generally, files are written just as they are read. For exceptions,
see the @option{--sparse} option below.
@opindex --dereference
Always follow symbolic links.
-@optNoTargetDirectory
-
@item -P
@itemx --no-dereference
@opindex -P
@optTargetDirectory
+@optNoTargetDirectory
+
@item -u
@itemx --update
@opindex -u
possible, their owner and group. Synopses:
@example
-install [@var{option}]@dots{} @var{source} @var{dest}
+install [@var{option}]@dots{} [-T] @var{source} @var{dest}
install [@var{option}]@dots{} @var{source}@dots{} @var{directory}
-install [@var{option}]@dots{} --target-directory=@var{directory} @var{source}@dots{}
-install -d [@var{option}]@dots{} @var{directory}@dots{}
+install [@var{option}]@dots{} -t @var{directory} @var{source}@dots{}
+install [@var{option}]@dots{} -d @var{directory}@dots{}
@end example
-In the first of these, the @var{source} file is copied to the @var{dest}
-target file. In the second and third, each @var{source} file is copied
-to the destination @var{directory}. In the last, each @var{directory}
-(and any missing parent directories) is created.
+@itemize @bullet
+@item
+If two file names are given, @command{install} copies the first file to the
+second.
+
+@item
+If the @option{--target-directory} (@option{-t}) option is given, or
+failing that if the last file is a directory and the
+@option{--no-target-directory} (@option{-T}) option is not given,
+@command{install} copies each @var{source} file to the specified
+directory, using the @var{source}s' names.
+
+@item
+If the @option{--directory} (@option{-d}) option is given,
+@command{install} creates each @var{directory} and any missing parent
+directories.
+@end itemize
@cindex Makefiles, installing programs in
@command{install} is similar to @command{cp}, but allows you to control the
permissions}). The default mode is @samp{u=rwx,go=rx}---read, write,
and execute for the owner, and read and execute for group and other.
-@optNoTargetDirectory
-
@item -o @var{owner}
@itemx --owner=@var{owner}
@opindex -o
@optTargetDirectory
+@optNoTargetDirectory
+
@item -v
@itemx --verbose
@opindex -v
@pindex mv
-@command{mv} moves or renames files (or directories). Synopsis:
+@command{mv} moves or renames files (or directories). Synopses:
@example
-mv [@var{option}]@dots{} @var{source} @var{dest}
+mv [@var{option}]@dots{} [-T] @var{source} @var{dest}
mv [@var{option}]@dots{} @var{source}@dots{} @var{directory}
+mv [@var{option}]@dots{} -t @var{directory} @var{source}@dots{}
@end example
-If the last argument names an existing directory, @command{mv} moves each
-other given file into a file with the same name in that directory.
-Otherwise, if only two files are given, it renames the first as
-the second. It is an error if the last argument is not a directory
-and more than two files are given.
+@itemize @bullet
+@item
+If two file names are given, @command{mv} moves the first file to the
+second.
+
+@item
+If the @option{--target-directory} (@option{-t}) option is given, or
+failing that if the last file is a directory and the
+@option{--no-target-directory} (@option{-T}) option is not given,
+@command{mv} moves each @var{source} file to the specified
+directory, using the @var{source}s' names.
+@end itemize
@command{mv} can move any type of file from one file system to another.
Prior to version @code{4.0} of the fileutils,
of its permissions. If the response does not begin with @samp{y} or
@samp{Y}, the file is skipped.
-@optNoTargetDirectory
-
@itemx @w{@kbd{--reply}[=@var{how}]}
@opindex --reply
@cindex interactivity
@optTargetDirectory
+@optNoTargetDirectory
+
@optVersionControl
@end table
Synopses:
@example
-ln [@var{option}]@dots{} @var{target} [@var{linkname}]
+ln [@var{option}]@dots{} [-T] @var{target} @var{linkname}
+ln [@var{option}]@dots{} @var{target}
ln [@var{option}]@dots{} @var{target}@dots{} @var{directory}
+ln [@var{option}]@dots{} -t @var{directory} @var{target}@dots{}
@end example
@itemize @bullet
-@item If the last argument names an existing directory, @command{ln} creates a
-link to each @var{target} file in that directory, using the
-@var{target}s' names. (But see the description of the
-@option{--no-dereference} and @option{--no-target-directory} options below.)
-
-@item If two file names are given, @command{ln} creates a link from the
-second to the first.
+@item
+If two file names are given, @command{ln} creates a link to the first
+file from the second.
-@item If one @var{target} is given, @command{ln} creates a link to that
-file in the current directory.
+@item
+If one @var{target} is given, @command{ln} creates a link to that file
+in the current directory.
-@item It is an error if the last argument is not a directory and more
-than two files are given. Without @option{-f} or @option{-i} (see below),
-@command{ln} will not remove an existing file. Use the @option{--backup}
-option to make @command{ln} rename existing files.
+@item
+If the @option{--target-directory} (@option{-t}) option is given, or
+failing that if the last file is a directory and the
+@option{--no-target-directory} (@option{-T}) option is not given,
+@command{ln} creates a link to each @var{target} file in the specified
+directory, using the @var{target}s' names.
@end itemize
+Normally @command{ln} does not remove existing files. Use the
+@option{--force} (@option{-f}) option to remove them unconditionally,
+the @option{--interactive} (@option{-i}) option to remove them
+conditionally, and the @option{--backup} (@option{-b}) option to
+rename them.
+
@cindex hard link, defined
@cindex inode, and hard links
A @dfn{hard link} is another name for an existing file; the link and the
The default is to treat a destination that is a symlink to a directory
just like a directory.
-This option is weaker than the @option{--no-target-directory} option,
-and has no effect if @option{--no-target-directory} is also given.
-
-@optNoTargetDirectory
+This option is weaker than the @option{--no-target-directory}
+(@option{-T}) option, so it has no effect if both options are given.
@item -s
@itemx --symbolic
@optTargetDirectory
+@optNoTargetDirectory
+
@item -v
@itemx --verbose
@opindex -v