从tar文件中提取-默认行为:覆盖还是保留?


Answers:


17

您可以自己尝试:

echo 1 > 1
echo 2 > 2
tar cf foo.tar 1 2
echo 3 > 1
echo 4 > 2
tar xf foo.tar
cat ?
1
2

创建了前两个文件(12)。foo.tar创建了一个存档。下一步更改了文件内容,然后将foo.tar其解压缩。如果您查看文件,将会看到旧内容。

因此--overwrite是默认值。


4
默认值为:--overwrite-dir提取时覆盖现有目录的元数据(默认)
janwen

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.