neversaint neversaint - 1 year ago 141
Linux Question

Tar archiving that takes input from a list of files

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


It contains:


Is there a way I can issue TAR command that takes
as input?
Something like

tar -cvf allfiles.tar -[someoption?] mylist.txt

So that it is similar as if I issue this command:

tar -cvf allfiles.tar file1.txt file2.txt file10.txt

Answer Source

Assuming GNU tar (as this is Linux), the -T or --files-from option is what you want.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download