您的位置:首页 > 其它

在find中使用pax或cpio 命令来实现将找到的所有文件压缩到一个压缩包

2012-12-06 11:06 585 查看
uote:
Originally Posted by alister



Code:
find path -type f '*.txt' | pax -w > txtarchive.tar


Many tar implementations have an option that allows them to read a file list from a file, allowing for find's output to be redirected and then read. In my opinion, not a very elegant solution. If I recall correctly, BSD tar uses -I and GNU tar
uses -T .
Like ps ,
tar is a ubiquitous utility whose usage, for anything non-trivial, varies a great deal between platforms of different lineage.

Regards,

Alister
Thank you, it worked with pax and cpio after
the proper fixes.

Code:
find path -name '*.txt' -type f  | pax -w > txtarchive.tar




Code:
find path -name '*.txt' -type f | cpio -ov -H ustar -F txtarchive.tar
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐