- 论坛徽章:
- 0
|
tar 源自 bsd,而 cpio 源自 sysv,基本上是同时出现的
它们的功能其实也差不多,总的来说 cpio 更灵活一些,可以从标准输入读取文件列表
但是 tar 更易用一些,所以 tar 的功能更广泛
另外 tar 格式和 cpio 格式还有一些细节的不同
这个文档简述了 tar 和 cpio 的历史
[lula] tar, cpio, and pax
http://lula.org/pipermail/lula_lula.org/2001-March/004383.html
GNU tar 的 manual 里有关于 tar 和 cpio 的比较
11.3 Comparison of tar and cpio
https://www.aleric.net/users/unix/tar/tar_123.html
这篇 cpio 的 howto 也谈及了 tar 和 cpio 的比较
它认为 cpio 的主要优点是灵活的文件选择机制,且便于和 find 联合使用
另外 cpio 生成的归档文件比 tar 要小一些 (但也不是总是这样)
但是相对的 cpio 的语法要比 tar 复杂,这是 cpio 的一个缺点
对比
find . -print |cpio -o >../archive.cpio
tar cf ../archive.tar .
cpio How-To & Quick Start
(Comparison with tar)
http://cybertiggyr.com/gene/cpio-howto/
这篇文档的作者是 cpio 的拥护者
Why is cpio better than tar?
http://rightsock.com/~kjw/Ramblings/tar_v_cpio.html
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/46451/showart_468895.html |
|