How to Create and Extract .tar.gz Archives in Linux (tar)

tar bundles multiple files and directories into a single archive file, optionally compressed with gzip.

Published September 30, 2026

tar bundles multiple files and directories into a single archive file, optionally compressed with gzip.

Key points

  • tar -czvf archive.tar.gz folder/ creates a gzip-compressed archive (c=create, z=gzip, v=verbose, f=filename)
  • tar -xzvf archive.tar.gz extracts a gzip-compressed archive (x=extract)
  • tar -tzvf archive.tar.gz lists an archive's contents without extracting it

Example

tar -czvf backup.tar.gz ./project
More Linux articles