gzip -dc archive.tar.gz|tar xf -
The above line can be modified when you should deal with broken archives. If you try to decompress such archive gzip just stop when find error in compression. But you want to save what's possible. So let's make it on this way:
cat archive.tar.gz|gzip -dc|tar xf -
I know it is possible to use GNU tar to extract files from compressed archive, but in UNIX world you can't be sure this software is installed :-)
Few remarks:
- It's wise to use 'f -' key because in some Unixes without explicit 'f' tar will use tape device or whatever is defiined in TAPE variable
- In above examples beside less diskpace usage you benefit from parallel execution (from pipe)
No comments:
Post a Comment