I have a large tar file, almost around 150GB. I need a single file from it, and am having trouble even estimating how long it would take to extract. If I do tar -xvf mytar.tar file.txt, nothing happens, even after I waited for an hour. I've tried opening the file in python, but calling extract returns nothing as well.

I could iterate the files in the tar when opening it with python, but am a bit at a loss. I did try unpacking the whole tar ball, but after running for 8 hours, it only managed to extract 1/3 of the content, then died for some reason.

I'm really at a loss with what to do, could the file be corrupt? If so, are there any tools I could use to see if the file I need is in there?

  • Can you run pv -d $(pidof tar) while tar is trying to extract the file? – user1686 Nov 18 '19 at 19:54

I suppose the best test is to list the files, something like:

tar -tvf tarball.tar

You will be able to see the files, and verify that your file is listed before a possible corruption point is reached.

If you want to both see the output and conserve it, use:

tar -tvf tarball.tar | tee outfile

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.