tar xzf backup.tar.gz -C /restore-dir

Category: Backup & Restore

tar xzf backup.tar.gz -C /restore-dir

Extract a tar.gz archive into a directory

Unpacks backup.tar.gz into /restore-dir, which must exist: x extracts, z decompresses, f names the archive and -C sets the destination. Files are written relative to that directory, overwriting same-named files. Check contents first with tar tvf backup.tar.gz.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.