Tar archiving that takes input from a list of files

前端 未结 6 2112
[愿得一人]
[愿得一人] 2020-12-22 17:12

I have a file that contain list of files I want to archive with tar. Let\'s call it mylist.txt

It contains:

file1.txt
file2.txt
...
file         


        
6条回答
  •  粉色の甜心
    2020-12-22 17:49

    Some versions of tar, for example, the default versions on HP-UX (I tested 11.11 and 11.31), do not include a command line option to specify a file list, so a decent work-around is to do this:

    tar cvf allfiles.tar $(cat mylist.txt)
    

提交回复
热议问题