我在一个名为.txt的文件中列出了很多文件名,to_be_archived_files.txt
其内容如下:
~/Documents/dir1/a.html
~/Documents/dir1/b.html
~/Documents/dir1/c/1.html
如何将它们全部添加到archive.tar.gz
by tar中?
我想要类似的东西:
tar czf archive.tar.gz -FROM-FILELIST=to_be_archived_files.zip
我该如何实现?
使用-T
选项:
-T, --files-from FILE
get names to extract or create from FILE
请注意,它不能用~
作主目录的别名,您需要显式指定文件夹。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句