From: Jim Meyering Date: Sat, 2 Mar 2002 17:35:39 +0000 (+0000) Subject: (cp invocation): Document that cp -r X-Git-Tag: FILEUTILS-4_1_6~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=846263ddff9cddb44e1d0099d092506cf2cfe3c7;p=thirdparty%2Fcoreutils.git (cp invocation): Document that cp -r preserves symlinks. Emphasize non-portability of cp -r. --- diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 65e3cbc385..bac04fa8ae 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -5803,9 +5803,10 @@ any missing intermediate directories. @cindex recursively copying directories @cindex non-directories, copying as special files Copy directories recursively, copying any non-directories and special -files (e.g., symbolic links, FIFOs and device files) as if they were -regular files. This means trying to read the data in each source -file and writing it to the destination. It is usually a mistake to +files (e.g., FIFOs and device files) as if they were regular files. +This means trying to read the data in each source file and writing it to +the destination. However, contrary to most other implementations, +GNU @code{cp -r} preserves symbolic links. It is usually a mistake to apply @code{cp -r} to special files like FIFOs and the ones typically found in the @file{/dev} directory. In most cases, @code{cp -r} will hang indefinitely trying to read from FIFOs and special files @@ -5814,6 +5815,8 @@ if you use it to copy @file{/dev/zero}. Use the @option{--recursive} (@option{-R}) option instead if you want to copy special files, preserving their special nature rather than reading from them to copy their contents. +It is not portable to use @code{cp -r} to preserve symbolic links. +On most non-GNU systems, @code{cp -r} does @emph{not} preserve symbolic links. @itemx @w{@kbd{--reply}[=@var{how}]} @opindex --reply