Ftp – Untar selected files in .tar.gz file from remote ftp server

ftpremotetar

Lets say i have a big backup.tar.gz file in a remote ftp server. I needed some files from it but i dont want to download/untar all of it. Just specific files/folder.
normally this is code to select files from a tar.gz file:

tar zxf backup.tar.gz /the/file/you/want

but.. from ftp server without downloading it? Is it possible?

Best Answer

This is not possible. To extract a specific file from the tar file you will fist have to extract the the tar file from the .gz file. To do this you will have to read the whole .gz file. Once you've done this you still have to read the tar file sequentially to find the start of the file you want to extract.