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

查看:12
本文介绍了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天全站免登陆