I have a few BIG .tar.gz files, and I want to make sure they will uncompress, but without actually doing it.

If the file opens on "Archive Manager" on Ubuntu, and I can view it contents there, does that mean the .tar.gz will successfully uncompress when I try to?

link|improve this question
Is this a programming question? – AaronS Nov 28 '10 at 4:19
Doesn't sound like it, but it could be ... Hurans, are you trying to check the file using a PHP script? (assuming this is the case from other recently posted question) – Will Nov 28 '10 at 4:21
feedback

migrated from stackoverflow.com Nov 29 '10 at 4:12

This question came from our site for professional and enthusiast programmers.

2 Answers

No easy way - as .tar.gz are compressed, in order for tar to check anything, it needs to uncompress it through gzip. The closest you can get is list the file:

tar -tzf file.tar.gz

but that will trigger uncompressing (the .gz part), so if your file is big, you will have to wait, especially if you are doing it over network. Locally, I think you should be rather OK - you are going to wait, but it's going to finish in a few hours or a day unless we are talking TBs.

link|improve this answer
feedback

Good lads provide cryptographic checksums like MD5, SHA1 or SHA256 together with big .tar.gz files. Match the computed checksum against the original one. This is a good bet that your file is healthy (assuming the original checksum wasn't computed against a broken tarball).

link|improve this answer
feedback

Your Answer

 
or
required, but never shown