Click to See Complete Forum and Search --> : unTar a single file
soleblazer
04-02-2001, 06:48 PM
I feel ridiculous asking this, but I have mind freeze.
If I do a tar -tvf and see a single file I want to extract, how do I do that?
tks
sole
Tyr-7BE
04-02-2001, 07:44 PM
tar -vxf filename will probably do it for you. If that doesn't work then re-arrange the order.
If it's a tar.gz file, then it's tar -zvxf filename.
ever tried mc (Midnight Commander)
Or is'nt it installed ????
If mc is installed you set focus on the tar file press enter just as you would enter an directory.
your going in the tar then, and then you can use the copy command (F5 if I am not wrong) to extract that single file.
very easy :D
drmbb
04-02-2001, 08:54 PM
And if it's a foo.tar.bz or foo.tar.bz2 then just use tar -xIvf.
Linuxcool
04-02-2001, 10:20 PM
I believe what he wants to do is just extract one file from the tar file. To do that enter:
tar -x --file=' tar_file_name ' ' name_of_the_file '
Where ' tar_file_name ' is the name of the tar file like ' test.tar ' and the ' name_of_the_file ' is the name of the file that you get when you use the ' tar -t tar_file_name ' command. Make sure you enter the file name exactly as the ' tar -t filename.tar ' command lists it, including the full path list to the file.
Examples: file name by itself- foo.bar
file name with path list- new/file/FOO.Bar
I hope this is what you wanted.
[ 02 April 2001: Message edited by: Linuxcool ]
[ 02 April 2001: Message edited by: Linuxcool ]
soleblazer
04-02-2001, 10:39 PM
thankw, that is what i was after.
cj
:eek:
Linuxcool
04-03-2001, 05:47 PM
I found a slightly simpler version of the tar command to use:
tar -xf ' tar_file_name ' ' name_of_the_file '
Also, I made a mistake in this command:' tar -t tar_file_name '
It should be:' tar -tf filename.tar '
One other thing is that you can extract more than one file at a time. Just keep adding the file names that you want to the end of the command.
Like this: : tar -xf ' tar_file_name ' ' name_of_the_file1 ' ' name_of_the_file2 ' ...
[ 03 April 2001: Message edited by: Linuxcool ]