Creating, listing and extracting a tar.gz archive

 · 1 min · torgeir

Terminal Tar Gzip

You can create a .tar.gz archive of a folder using

tar -cvfz archive.tar.gz folder

You can list contents of a tar file using

tar -ztvf archive.tar.gz

You can extract it using

tar -xvfz archive.tar.gz

You can extract it to a given folder using

tar -xvfz archive.tar.gz -C folder

Resources