Guides
Choose a compression or disk image format
Decide whether you need to bundle multiple files, compress one stream, or preserve a disk image's structure.
Which format should you choose?
Choose by the role each file plays in your workflow.
- Bundle several files for distribution → ZIP
- Compress one file on Unix-like systems → GZIP, BZIP2, or XZ
- Bundle and compress on Unix-like systems → tar.gz, tar.bz2, or tar.xz
- Preserve a disk image's structure → ISO
Separate archiving from compression
ZIP can package multiple files. GZIP, BZIP2, and XZ compress a single stream; combine one with tar when multiple files must be packaged on Unix-like systems.
Check the source before extraction
Compressed files and ISO images may contain executables. Confirm the origin and expected size, then inspect the extracted contents before use.
Formats to consider
ZIP
Good for: Distributing multiple files to a broad audience
Less suitable for: Preserving disk structure
GZIP
Good for: Compressing one file or a tar archive
Less suitable for: Bundling multiple files by itself
BZIP2
Good for: Compressing or extracting files in BZIP2-supported workflows
Less suitable for: General delivery when extraction support is unknown
XZ
Good for: Compressing or extracting files in XZ-supported workflows
Less suitable for: Bundling multiple files by itself
ISO Image
Good for: Distributing an image that preserves disk structure
Less suitable for: Ordinary file compression
Before you export
- Do not infer the contents from the extension alone; inspect the extracted layout.
- Avoid extracting or running compressed files or ISO images from untrusted sources.