i have a huge gpg encrypted tar-gzip file ~100 GB. But only need a single folder from it. I can list/search the content by doing eg.

gpg -d file.tar.gz.gpg|tar -tz |grep "filename"|more

This is super fast and i can quickly find the folder i need.

But if i try to decrypt this single folder it takes for ever (the file is on a network store :-/). I tried:

gpg -d file.tar.gz.gpg |tar -xz /path/to/filename

Could it be that tar must stream through the complete folder? Or is it not working with gzip / gpg compressed files?

Update: thx to Xen2050, i copied the wrong command line arugement here. Fixed it in this post.


Both your examples use -c, decryption uses -d, and probably need --xz for tar but that would mix formats & wouldn't work, but I'll assume they're just typos and you've got them working, but anyway...

You'll have to wait until gpg & tar go through the whole archive until hitting your target file, it could be near the start or end so may get lucky. Tar & gpg behave kind of like they're going through a tape archive, but instead of using grep you can see the files decrypted "live" by just outputting the file list to stdout.

Try getting a terminal on the local machine to speed things up, if the network is the bottleneck.

  • thx for your clearup. You are right i c/p the wrong command. Will fix it. thx for your explanation – PlagTag Jan 11 '16 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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