簡體   English   中英

如何將多個 tar 文件合並為一個 tar 文件

[英]How to combine multiple tar files into a single tar file

根據 gnu 文檔,要將一個或多個存檔添加到另一個存檔的末尾,我可以使用“--concatenate”操作。

但是在我的測試中,我發現我一次不能添加多個文件。

# ls -al
total 724
drwxr-xr-x.  3 root root     60 Oct 14 17:40 .
dr-xr-xr-x. 32 root root   4096 Oct 14 16:28 ..
-rw-r--r--.  1 root root 245760 Oct 14 18:07 1.tar
-rw-r--r--.  1 root root 245760 Oct 14 18:07 2.tar
-rw-r--r--.  1 root root 245760 Oct 14 18:07 3.tar
# tar tvf 1.tar
-rw-r--r-- root/root    238525 2021-10-14 17:28 1.txt
# tar tvf 2.tar
-rw-r--r-- root/root    238525 2021-10-14 17:29 2.txt
# tar tvf 3.tar
-rw-r--r-- root/root    238525 2021-10-14 17:29 3.txt

似乎它只選擇了第一個參數並忽略了其余部分

# tar -A -f 1.tar 2.tar 3.tar
# tar tvf 1.tar
-rw-r--r-- root/root    238525 2021-10-14 17:28 1.txt
-rw-r--r-- root/root    238525 2021-10-14 17:29 2.txt

正如優秀而全面的超級用戶回答中所述

這是 gnu tar 中的一個已知錯誤(2008 年 8 月報告)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM