LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   TAR Extract Question. (https://www.linuxquestions.org/questions/linux-newbie-8/tar-extract-question-515016/)

swamprat 12-30-2006 06:57 PM

TAR Extract Question.
 
Help..

I have a huge tar file and I only need one file from it.

I've been trying to extract the one file with the following command but can't seem to get it.

Could anyone give me a hand with the proper command:

tar -xvf blog_work_linux.tar

I need the Readme.txt file from this tar file. I've tried a number of commands such as:

tar -xvf blog_work_linux.tar Readme.txt

and

tar -xvf blog_work_linux.tar /Readme.txt

and nothing works.

Thanks.:cry:

bigrigdriver 12-30-2006 07:07 PM

Quote:

tar -xvf blog_work_linux.tar Readme.txt
That's the correct syntax for extracting one file. Question: are you certain you spelled Readme.txt correctly? Are you sure it isn't README.txt?

"tar --list --file=blog_work_linux.tar" to list the archive and verify the spelling and case of Readme.txt.

swamprat 12-30-2006 09:15 PM

Thanks bigrigdriver.

Yep. that the correct name of the file.

masonm 12-30-2006 10:53 PM

Try opening it with a GUI archiving tool and verify the name. You can extract the one file with the same GUI tool.

Ha1f 12-30-2006 11:39 PM

do
Code:

tar -t blog_work_linux.tar
to make sure thats the correct name of the file.

FnordPerfect 12-31-2006 12:42 AM

hm, strange.
Look at the tarball's content using

$ tar -tf blog_work_linux.tar

and check whether the Readme.txt is in the "root directory" of the tar.
In case it is contained in a sub-directory you have to give the tar command the full path to it!

e.g.
Code:

tar -tf blog_work_linux.tar
docs/Readme.txt
docs/HOWTO.html
stuff/
stuff/1.html
stuff/2.html

then you have to type

tar -xf blog_work_linux.tar docs/Readme.txt

Or ... just use a GUI utility, as proposed.

swamprat 12-31-2006 10:17 AM

Thanks all,

I'll try some of this out and advise.


All times are GMT -5. The time now is 12:33 AM.