Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer
In addition, tar continues reading through the entire file even once it has found the files you want to extract. – Ladadadada Mar 8 '12 at 18:14

It might be possible using CurlFtpFS. You would have to verify that it does not download the entire tar file when you operate on it.

share|improve this answer
The entire tar (up to the end of the last file) must be downloaded for the files to be extracted due to the compression. – Ignacio Vazquez-Abrams Apr 26 '11 at 1:55
Looking more closely at the tar format, I see that this would be a problem even if it wasn't gzipped. – sciurus Apr 26 '11 at 2:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.