Understanding of packaging and compression in Linux

  
        

In linux, I often use the tar command to "package compression", which seems to be called often, but these two are different.

The so-called packaging is to break some of the files into a package, but the volume will not change, the size is still the size of the file before packaging, just put in a package, used in linux It is a tarball tool, which is the tar command we often use. However, compression not only links files together, but also performs specific algorithms to compress them. For txt files that are very "loose", you can greatly reduce the size of the file. Compressed with the gzip tool in linux, often used with the tar command. Because of the use of tar and gzip tools, many files that are packaged and compressed will be written as ***.tar.gz or simply written as ***.tgz. However, due to the better compression of bzip2 recently, tarball is gradually replacing gzip with bzip2 compression technology. Therefore, you will often see compressed files like ***.tar.bz2.

Attach tar specific command:

(1) Format: tar parameter......

(2) Parameters:

c : Create Backup

v: Indicates echo mode (Verbose), which will generate a list of files to be backed up.

f: Specify the backup file to be used. The parameter following it is output. Backup file name

x: Expand backup file

t: Display the contents of the backup file

T: Follow a file parameter, specify to read from this file The path to each file being backed up. If you do not use the T parameter, you will need a parameter indicating the path to the backup file and directory

Z: Create and unpack the backup file using compression. This is the new version of GNU's tar function, which needs to be installed at the same time. Gzip.

Copyright © Windows knowledge All Rights Reserved