Linux上的GZip可以归档文本文件中指定的文件 [英] GZip on Linux to archive files specified in the text file

查看:98
本文介绍了Linux上的GZip可以归档文本文件中指定的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本文件,该文件的路径指向我要压缩为单一存档的文件列表.如何将该文件传递给GZIP,以便它可以使用列表中指定的所有文件来创建该归档文件?

I have a text file with paths to the list of files I want to compress into a singe archive. How can I pass this file to GZIP so it can create that archive with all files specified in the list?

米兰

推荐答案

gzip一次只能处理一个文件.您需要先使用tar存档文件. Tar可以同时进行压缩(使用"z"参数).

gzip can only handle a single file at a time. You'll need to archive the files using tar first. Tar can do the compression at the same time (using the "z" argument).

tar cfz archive.tar.gz `cat file`

这篇关于Linux上的GZip可以归档文本文件中指定的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆