.Z files (deletes processed file after compressing/uncompressing)
- to compress:
$ compress file_name
- to uncompress:
$ uncompress file_name
.gz files (deletes processed file after zipping/unzipping)
- to zip:
$ gzip file_name
- to unzip:
$ gunzip file_name
-
to open a gz file without deleting the zipped file after unzipping,
gunzip (or bunzip2 for bz2 files) with -c (console output) and redirection
in order to keep the original file:
$ gunzip -c file_name.gz > file_name
.tar files
- to create:
$ tar cvf file_name.tar files_to_process
- to extract:
$ tar xvf file_name.tar
- to view content:
$ tar tf file_name.tar
.tgz and .tar.gz files
$ tar xzvf file_name.tgz
does the same as: $ gunzip -c file_name.tar.gz | tar xv
.tar.bz2 files
$ tar xIvf file_name.tar.bz2