undocumented tar --unlink switch

Josh Carroll josh.carroll at gmail.com
Sat Aug 2 23:53:19 UTC 2008


> Around line 37 of /usr/src/usr.sbin/pkg_install/add/extract.c
> there's an invocation of /usr/bin/tar with a --unlink switch,
> which I don't see mentioned in the tar(1) manpage.  Anyone
> happen to know what this does, or do I need to dig into the
> code?

My guess was that it was the long option version of -U:

     -U      (x mode only) Unlink files before creating them.  Without this
             option, tar overwrites existing files, which preserves existing
             hardlinks.  With this option, existing hardlinks will be broken,
             as will any symlink that would affect the location of an

A quick perusal of the source confirms.

Josh


More information about the freebsd-questions mailing list