By: Erik Solis | Published: 09/02/2023 @ 11:30 PM EST
The “.tar.gz” format combines two types of compression. First, the “.tar” extension stands for “tape archive,” which bundles multiple files and directories into a single archive file without compressing them. Then, the “.gz” extension represents the “gzip” compression, which is applied to the “.tar” archive to reduce its size. This two-step process creates a compressed archive that retains the file structure while reducing overall size. It’s commonly used in Unix-like systems for archiving and distributing files.
You can create a gzipped tar archive using the tar
command like so:
tar -zvf archive_name.tar.gz files_or_directories_to_archive
Here's what each part of the command does:
tar
: The command itself for working with tar archives.z
: Compresses the archive using gzip.v
: Displays verbose output, showing the files being archived.f
: Specifies the filename of the archive.archive_name.tar.gz
: Replace this with the desired name for your archive.