How to Use the Tar Command in Linux

The tar command is used to combine multiple files into a single archive (often compressed with gzip).

Creating a Tar Archive

  1. Open your terminal.
  2. Type tar -czvf backup.tar.gz /folder/to/compress.
  3. c creates the archive, z compresses it with gzip, v makes it verbose (shows progress), and f specifies the filename.
  4. Press Enter to create the archive.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.

Receive our best articles and tips delivered straight to your inbox.