3 Responses to “Extract Single File From Tar-Archive Without Specifying The Directory”
I can’t figure out what the “–no-anchored” option does, and the “z” option is missing from this example – here’s what works for me:
tar xzvf some.tgz path/some.txt
where path/some.txt is the path shown for the file when you do:
tar tzvf some.tgz
2004-12-21 Version 1.15:
Compressed archives are recognised automatically, it is no longer necessary to specify -Z, -z, or -j options to read them. Thus, you can now run tar tf archive.tar.gz and expect it to work!
You almost answered your question for yourself. with the –no-anchored parameter you dont have to specify the path, so if you know the filename but not the path, you don’t have to search for the file. or if you have deeply nested directories, you don’t have to type that much .
I can’t figure out what the “–no-anchored” option does, and the “z” option is missing from this example – here’s what works for me:
tar xzvf some.tgz path/some.txt
where path/some.txt is the path shown for the file when you do:
tar tzvf some.tgz
2004-12-21 Version 1.15:
Compressed archives are recognised automatically, it is no longer necessary to specify -Z, -z, or -j options to read them. Thus, you can now run tar tf archive.tar.gz and expect it to work!
You can check this here: http://www.gnu.org/software/tar/
You almost answered your question for yourself. with the –no-anchored parameter you dont have to specify the path, so if you know the filename but not the path, you don’t have to search for the file. or if you have deeply nested directories, you don’t have to type that much .
thanx