Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 09-23-2005, 02:24 PM   #1
Registered: Apr 2004
Location: Belgium Antwerpen
Distribution: slackware - knoppix
Posts: 141

Rep: Reputation: 18
tar: getting files from a file.


I'm trying to create a tar archive. The input files are listed in one textfile.
How can I get tar to use this inputfile? Redirection like "tar -cvf t.tar < inputfile" doesn't work. I tried "tar -cvf t.tar `inputfile`" (tar -cvf t.tar `find directory -mtime -1 -f` did work fine)
I was looking through the man pages and found some option -T which made me think that it could do the job but can't figure out how to get it actually work.
I tried things like "tar -cvf t.tar -T inputfile" and "tar -cv -T inputfile -f t.tar" etc etc but none worked as I expected.

Can anyone point me in the right direction?
Did I completely misunderstand what the -T stands for?

Old 09-23-2005, 02:46 PM   #2
Registered: Apr 2004
Location: Belgium Antwerpen
Distribution: slackware - knoppix
Posts: 141

Original Poster
Rep: Reputation: 18
my mistake...

The find commands that I used to populate the inputfile also included the directory names where the files were in. Therefore, tar also took the complete directory as input instead of only some files.

find /home -mtime -1 -type f


=> I only wanted the f1 and f2 ofcourse. I think I'll just need to use the -X modifier also to exclude these directories.

sorry for this.
Old 09-23-2005, 06:30 PM   #3
Senior Member
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
tar cvf mytarfile.tar `cat inputfile`
Those are backticks around cat (etc), not apostropes.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 02:48 AM
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 5 11-08-2010 11:02 AM
gave wrong syntax for tar as tar -cvzf file file.tgz how to recover the file gautham Linux - General 4 04-13-2005 03:15 AM
list files in a tar.gz file linuxtesting2 Linux - Newbie 4 09-23-2004 02:49 AM
what file association to use for tar gz files dogface Fedora - Installation 5 08-09-2004 03:04 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:42 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration