Next: Hard Links, Previous: Portable Names, Up: Making tar
Archives More Portable [Contents][Index]
Normally, when tar
archives a symbolic link, it writes a
block to the archive naming the target of the link. In that way, the
tar
archive is a faithful record of the file system contents.
When --dereference (-h) is used with
--create (-c), tar
archives the files
symbolic links point to, instead of
the links themselves.
When creating portable archives, use --dereference (-h): some systems do not support symbolic links, and moreover, your distribution might be unusable if it contains unresolved symbolic links.
When reading from an archive, the --dereference (-h)
option causes tar
to follow an already-existing symbolic
link when tar
writes or reads a file named in the archive.
Ordinarily, tar
does not follow such a link, though it may
remove the link before writing a new file. See Options Controlling the Overwriting of Existing Files.
The --dereference option is unsafe if an untrusted user can
modify directories while tar
is running. See Security.