Tar backup basic usages


Task: List the contents of a tar file
Use the following command:
$ tar -tvf file.tar
Task: List the contents of a tar.gz file
Use the following command:
$ tar -ztvf file.tar.gz
Task: List the contents of a tar.bz2 file
Use the following command:
$ tar -jtvf file.tar.bz2


-
COMPRESS ( p = preserve permissions) 
tar -zcpvf prog-1-jan-2005.tar.gz /home/alex/stufftobackup

DECOMPRESS ( p = preserve permissions) 
tar -zxpvf prog-1-jan-2018.tar.gz

Comments