On Thu, Jun 24, 2010 at 04:37:25AM +0800, mcclnx mcc wrote:
I am doing "tar" test due to some software require "tar cvhf". When I using "tar cvhf and tar xvhf ", files have symbolic link replace by physical files.
wield things is my friend using same command 'tar cvhf and tar xvhf". after restore link still there.
I find it unlikely he's using the same command line; see below.
does there has way when I using "tar cvhf" and "tar xvhf" I can get link back not physical files?
-h / --dereference does not archive / follow the link but rather the file that the link points to; it dereferences it during archive creation.
Simple answer: do not use -h / --dereference and you will have the behavior you wish.
As always, "man tar" for more information.
John