1. compressed file format
.zip .gz .bz2 .tar.gz .tar.bz2
2. commands for zip format
zip [compressed file name] [source file name]
zip -r [compressed file name] [source directory name]
unzip [compressed file name]
3. commands for gz format
gzip [source file name] -> the source file will be deleted
gzip -c [source file name] > [compressed file name] -> the source file will not be deleted
gzip -r [source directory name] -> compress all the files one by one under source directory, can not compress the directory
gzip -d [compressed file name] -> decompress the file
gunzip [compressed file name] -> decompress the file
gunzip -r [compressed directory file name] -> decompress the directory
4. commands for bz2 format (can not compress the directory)
bzip2 [source file name] -> the source file will be deleted
bzip2 -k [source file name] -> the source file will be not deleted
bzip2 -d [compressed file name] -> decompress the file
bunzip2 [compressed file name] -> decompress the file
5. commands for .tar
tar -cvf [package file name] [source file name]
-c pack
-v view process
-f specify file name after the package
tar -xvf [package file name]
-x unpack
tar -zcvf [package file name] [source file name]
-z compress the directory to .tar.gz format -> use blank to add anothor file
tar -zxvf [package file name]
-x decompress the .tar.gz format file
tar -jcvf [package file name] [source file name]
-j compress the directory to .tar.bz2 format
tar -jxvf [package file name]
-x decompress the .tar.bz2 format file
tar -[zxvf / jxvf] -C
-C specify the directory for decompressed files
tar -ztvf [package file name]
-t test the package file name that see the list of the packed files