bash:/bin/tar:使用tar压缩许多文件时,参数列表过长 [英] bash: /bin/tar: Argument list too long when compressing many files with tar
本文介绍了bash:/bin/tar:使用tar压缩许多文件时,参数列表过长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用命令
tar -czvf compress_file.tar.gz $(cat file_list.txt)
我有一个错误
-bash: /bin/tar: Argument list too long
文件数太长,该如何解决?
The files numbers is too long, how can I resolve this?
推荐答案
使用"-T"选项将文件传递到包含tar的文件名的tar.
Use the "-T" option to pass a file to tar that contains the filenames to tar up.
tar -cv -T file_list.txt -f tarball.tar
这篇关于bash:/bin/tar:使用tar压缩许多文件时,参数列表过长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文