by in Developer Notes

Tar.gz compressed archives are the most common way that software is distributed for use on Unix/Linux systems. We’ve learned another way to unpack these files from the command line when using Solaris, the distribution that Joyent uses for their shared hosting.

For most systems, the command for decompressing and extracting tar.gz files is something like this:

tar -xzf file.tar.gz

In this case, the -x indicates extraction, -z indicated to run through gzip, and -f to save the results to the filesystem.

However, this does not work on some systems, in our case when working with Solaris. The alternative command in this case is:

gzip -dc file.tar.gz | tar xf –

This decompresses the file and then pipes it to tar for extraction.

Leave a Reply

You must be logged in to post a comment.

About Dana Hutchins

Dana is founder of Inforest Communications and has over fifteen years of Web design and development experience. Dana is involved in all aspects of business development and marketing of the firm, including serving as primary consultant on Internet and Web strategy to Inforest clients. His Web development responsibilities are primarily focused on writing custom modules,themes and plugins to make Drupal and WordPress sites run and look better. He also writes custom Web applications that have been used in online calendaring, e­-commerce and surveys.

Dana’s favorite programming acronyms are PHP, MySQL, CSS3, HTML5 and jQuery. However, what really gets him excited is the opportunity to use these tools to build Web sites that solve business needs and create new opportunities for his clients.