bug#17578: cp(1) man page: behavior of "cp -R dir target" on symbolic li
From:
Pádraig Brady
Subject:
bug#17578: cp(1) man page: behavior of "cp -R dir target" on symbolic links is unclear
Date:
Sun, 25 May 2014 12:13:42 +0100
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2
On 05/24/2014 04:07 PM, Vincent Lefevre wrote:
> The cp(1) man page does not describe the behavior on symbolic links
> when copying recursively. It appears that in such a case, cp does not
> dereference the links (this is also what the info file says: "When
> copying from a symbolic link, `cp' normally follows the link only
> when not copying recursively."). Tested with cp (GNU coreutils) 8.21
> on Debian/unstable.
>
> As the usual behavior of utilities on symbolic links is to follow the
> links, this may be surprising to the user who only reads the man page
> (even if he knows POSIX, as POSIX doesn't specify the behavior if
> only -R is used).
>
> So, the man page should say that by default (e.g. without -H, -L, -P),
> cp follows source symbolic links only when not copying recursively.
I suppose we could adjust --help (and thus the man page) like:
- -R, -r, --recursive copy directories recursively
+ -R, -r, --recursive copy directories recursively (implies -P)