User Tools

Site Tools


linux:ubuntu_tar_cheat_sheet

Tar Cheat Sheet

Create Tar File

Create tar.gz file preserve permissions verbose output to stdout.

tar cvfp - FileOrFolder | gzip -c > archivename.tar.gz

Create tar.gz file preserve permissions silent.

tar cfp - FileOrFolder | gzip -c > archivename.tar.gz

Create tar.gz file ignore file permissions verbose output to screen.

tar cvf - FileOrFolder | gzip -c > archivename.tar.gz

Create tar.gz file ignore file permissions silent.

tar cf - FileOrFolder | gzip -c > archivename.tar.gz

Extract Tar File

Extract tar file preserve permissions verbose to stdout.

tar zxvfp FileOrFolder.tar.gz

Extract tar file preserve permissions silent.

tar zxfp FileOrFolder.tar.gz

Extract tar file ignore permissions verbose to stdout.

tar zxvf archivename.tar.gz

Extract tar file ignore permissions silent.

tar zxf archivename.tar.gz

Extract tar file to a specific directory.

tar zxvfp archivename.tar.gz -C /directory

List Tar File

List contents of a tar file

tar -tvf archive.tar

List contents of a tar.gz file

tar -ztvf archive.tar.gz

List contents of a tar.bz2 file

tar -jtvf archive.tar.bz2
linux/ubuntu_tar_cheat_sheet.txt · Last modified: 22/04/2022 12:37 by 127.0.0.1