How to Convert TAR to TGZ

by Allen Bethea, Demand Media

The Gzip file compression utility can help save space on your hard drive.

Thinkstock/Comstock/Getty Images

The TAR, or Tape Archive, file format was developed to simplify the process of storing and distributing multiple Unix operating system files. TAR files are uncompressed archives with the ".tar" file extension. The Gzip utility will compress TAR files and save your company hard drive space and network bandwidth. TAR files compressed with Gzip are called TGZ files or "tarballs" and have the interchangeable “.tar.gz” or “.tgz” file extension. Ubuntu and other Linux operating systems have native command line and graphical user interface tools to create TGZ files. Windows users can't create TGZ files, however, without acquiring and installing a third-party application.

Using Ubuntu Archive Manager

Step 1

Click the Home folder icon in the Unity launcher. Move to the folder containing the TAR format file you want to compress using the Nautilus file manager.

Click the arrow next to the text "File Format: By Extension." Scroll down and click on "Tar compressed with gzip (.tar.gz)"

Step 5

Click the "Create" button to create the compressed archive.

Step 6

Click the "Close" button.

Using Gzip

Step 1

Press "Ctrl-Alt-T" to launch the Linux terminal.

Step 2

Move to the directory holding the TAR file you want to compress using the "cd" command. For instance, if your archive is in the programming directory of your Documents folder, type "cd Documents/programming" at the command prompt and press the "Enter" key.

Step 3

Type "gzip yourfile.tar" at the command prompt, replacing "yourfile.tar" with the name of the TAR file you are compressing. Press the "Enter" key.

Tips

By default, the Gzip command deletes the original TAR file after it creates the compressed version. You can instruct Gzip to retain the original file by using the "-c" option and using the ">" redirection command to create a separate TGZ file. Type:

gzip -c yourfile.tar >yourfile.tar.gz

at the command prompt, replacing "yourfile.tar" with the name of the TAR file you are compressing. Press the "Enter" key.

Warning

When you extract TGZ archives using Nautilus and the Archive Manager, a new folder will be created with the same name as the archive, minus the ".tar.gz" extension. If a folder by that name already exists, a new folder will be created with a number in parentheses added to show that it is a duplicate. While this prevents older file versions from being overwritten, it can inflate the number of files your company's IT department has to store, maintain and back up. If you don't need to retain an older version of the files in an archive, you can delete the original copy and rename the duplicate.

About the Author

Allen Bethea has written articles on programming, web design,operating systems and computer hardware since 2002. He holds a Bachelor of Science from UNC-Chapel Hill and AAS degrees in office technology, mechanical engineering/drafting and internet technology. Allen has extensive experience with desktop and system software for both Windows and Linux operating systems.

Photo Credits

Have Feedback?

Thank you for providing feedback to our Editorial staff on this article. Please fill in the following information so we can alert the Small Business editorial team about a factual or typographical error in this story. All Fields are required.