Comment 2 for bug 1644467

Revision history for this message
Shangzhong Zhu (zhusz) wrote :

Here is the detailed descriptions about --unlink-first and overwrite option:

--unlink-first:
Remove files before extracting over them.
This can make tar run a bit faster if you know in advance that the extracted files all need to be removed.
Normally this option slows tar down slightly, so it is disabled by default.
(Refer to http://www.gnu.org/software/tar/manual/html_node/Unlink-First.html)

--overwrite:
Overwrite existing files and directory metadata when extracting files from an archive.
This causes tar to write extracted files into the file system without regard to the files already on the system;
i.e., files with the same names as archive members are overwritten when the archive is extracted.
It also causes tar to extract the ownership, permissions, and time stamps onto any preexisting files or directories.
If the name of a corresponding file name is a symbolic link,
the file pointed to by the symbolic link will be overwritten instead of the symbolic link itself (if this is possible).
Moreover, special devices, empty directories and even symbolic links are automatically removed if they are in the way of extraction.
Be careful when using the `--overwrite' option, particularly when combined with the `--absolute-names' (`-P') option,
as this combination can change the contents, ownership or permissions of any file on your system.
Also, many systems do not take kindly to overwriting files that are currently being executed.
(Refer to http://www.gnu.org/software/tar/manual/html_node/Overwrite-Old-Files.html#SEC76)