How to extract tar archives

Published 2025-10-20 14:24:39 UTC


How to extract tar archives


The `tar` command is commonly used to compress or extract archive files.


To extract a .tar.gz file:

tar -xvzf <ARCHIVE.tar.gz>

To create one:

tar -cvzf <ARCHIVE.tar.gz> <DIRECTORY>

Flags explained: c = create, x = extract, v = verbose, z = gzip compression, f = file name.