When I download a .tar.gz file, I open it with two commands, first gunzip
and then tar
.
Is it possible to open it with just one command?
Untar Single file from tar File compressed file
To extract a single file called video.mpeg from video.tar use the following command as given below example.
# tar -xvf video.tar video.mpeg
video.mpeg
Extracting Single file from tar.gz File
Use the following command to extract a single file codefile.xml from websitecode.tar.gz archive file
# tar -zxvf websitecode.tar.gz code.xml
code.xml
Extracting Single file from tar.bz2 File
Use the command to extract single file file.html from websitecode.tar.bz2
# tar -jxvfwebsitecode.tar.bz2 home/website/file.html
/home/website/file.html
Also you can read more about all the tar commands at This link explains all the useful tar commands available in linux