From: Rikishi42 on
On 2010-02-19, TP <TP(a)frenoespam.fr.invalid> wrote:

> 1/ cp -a preserves all hard links in a directory when copying this directory
> recursively (-a includes "R" option, in fact -a is "-dR --preserve=all"
> according to the manual page).
>
> 2/ But cp -a does not work to copy a single hard link (as I have tried in my
> example).
>
> In fact I do not need this feature, but by curiosity: why is it possible to
> preserve a hard link in the first case, but not in the second?

Perhaps you should consider that the first example copies a directry, not
individual files.

In your second case, cp handles the files one a a time, individually. When
you copy an individual file, the notion of preserving a link has no meaning,
as there is no other file to link to...

--
Any time things appear to be going better, you have overlooked
something.