Compression and Archives

tar

Creates and extracts archive files.

tar stores many files in one archive and is often combined with compression such as gzip.

Syntax
tar [options] archive [files...]

Arguments explained

  • -c creates an archive.
  • -x extracts.
  • -t lists contents.
  • -f names the archive file.
  • -z uses gzip.
  • -v shows verbose file names.

Common examples

Create a compressed archive
tar -czf project.tar.gz project/

Packs project into a gzip-compressed tar archive.

Extract an archive
tar -xzf project.tar.gz

Extracts files into the current directory.

tar Command
FieldDetails
Commandtar
CategoryCompression and Archives
Primary useCreates and extracts archive files.
Syntaxtar [options] archive [files...]