[CentOS] please help: How to copy all files under the folder

Wed Jun 23 17:19:25 UTC 2010
Les Mikesell <lesmikesell at gmail.com>

On 6/23/2010 11:58 AM, ann kok wrote:
> Hi all
>
> There are some soft/hard link. symoblic link files/folder under the top folder
>
> How to copy all files under this top folder?
>
> Thank you

I usually use rsync even for local copies, but cp -a will work too.  I 
like to cd into the source fold and use '.' as the source name so I 
don't have to remember the rules about whether a new directory is 
created under the target or not.  I don't think you can make the hard 
linked files become additional hard links to the same instance without 
saying to link everything, though.  If you use rsync, you have to add -H 
to hardlink the files together that are hardlinks in the source.  This 
is an inefficient operation and not automatically bundled in the '-a' 
option like most of the other attribute-preserving options.

-- 
   Les Mikesell
    lesmikesell at gmail.com