Tar Cheatsheet

Command-line tool for archiving and compressing files and directories

Updated at: March 10, 2025

Creating Archives

The tar (tape archive) utility bundles files and directories into a single archive file. It's commonly used with compression algorithms like gzip, bzip2, or xz to reduce file size.

Extracting Archives

Extracting files from tar archives is a common operation in Linux systems. The tar command provides various options to extract files with different compression formats, control extraction behavior, and manage file permissions.

Viewing Archive Contents

Tar provides various ways to examine archive contents without extracting them. You can list files, view detailed information, search for specific files, and verify archive integrity.

Advanced Operations

Advanced tar operations allow you to modify existing archives, perform incremental backups, work with multi-volume archives, and handle archives over network connections.

Options and Modifiers

The tar command offers numerous options that control its behavior. Understanding these options is essential for effectively creating, extracting, and managing archives with precise control over the operation.