This text reference: https://blog.csdn.net/afei__/article/details/82619843
Summary
The so-called package is put three pieces of files labeled as a package, but the volume will not change size or pack size of the hash file before, but is placed inside a bag, and in using this tool linux tarball it is also that is, we often use the tar command. However, not only to link the file compression, also features algorithms to compress, txt for such very "loose" file, you can greatly reduce the file size, using gzip compression in linux tool, often used in conjunction with the tar command. Because use of the tools tar and gzip, many files will be written after the compression packing ****. Tar.gz or simply written as ***. Tgz.
takes
-z: Use gzip to compress and decompress files
-v: - verbose detailed list files processed
-f: Use archive file or device, this option must pass the common sense
-c: - create create a new archive (archive)
-x: Solutions of the files from the archive
Packing and unpacking
tar packing and unpacking
Package: tar -cvf FileName.tar DirName
Unpack: tar xvf FileName.tar
Compression and decompression
tar archive: tar -zcvf compressed .tar.gz name Contents 1 Table of Contents 2
Unzip (1): tar -zxvf Compression name .tar.gz
Extracting (2): tar -zxvf compression codes extract the directory specified .tar.gz -C
View unzip the file: tar -ztvf compressed file name
Other: tar command is just a packaged tool, it is really compressed gzip or bzip2 and other commands to reach, such as gzip command but usually only handle a single file, not convenient, so by tar package, then compression is a good processing.
rar compression decompression
a: Add to archive
-r: recursive processing
x: to extract the absolute path to the file
Compression: rar a -r tes.rar file
Decompression: unrar x test.rar
zip compression decompression
-r: recursive processing
Compressed file
zip -r test.zip file name
unzip files
zip test.zip