– Compression and decompression:
The concept of archiving: grouping many scattered documents into one large document.
'Note:'
1.Organize many scattered documents into a single document.2.Just to become a document, the size of the original document does not change.Copy the code
The concept of compression: reduce the size of file space according to some algorithm. (Simple memory)
Concept of decompression: Decompress according to the inverse algorithm of an algorithm. (Simple memory)
Common compression commands: gzip -- compressed packages ending in.gz. Bzip2 - compressed packages ending with.bz2. Xz - compressed packages ending with.xz. Common decompression commands: gunzip -- compressed packages ending in.gz. Bunzip -.bz2-ending zip package unxz -.xz ending zip packageCopy the code
'Note:'
1.Compression ratio:` gzip < bzip < xz`
2.Compression speed:`gzip > bzip > xz`
Copy the code
-tar command :(archive and compress)
Tar compressed package name Compressed raw dataCopy the code
Common options:1.-c: Creates a tar package2.-x -- Decompress the package (automatically detect the package category)3.-f -- Specifies the name of the archive file4.-j --bzip2 End compression package5.-z --gz Compressed package at the end6.-j --xz end compressed package7.-c indicates the decompression path8.-t -- Displays a list of archive files (view the contents of the tar package without unzipping)9.-p -- Preserves absolute paths for packagingCopy the code
– Code display:
tar -zcf ./1.txt.tar.gz ./1.txt
Copy the code
tar -jcf ./1.txt.tar.bzip2 ./1.txt
Copy the code
tar -Jcf ./1.txt.tar.xz ./1.txt
Copy the code
tar -tf ./1.txt.tar.gz
Copy the code
tar -xf ./1.txt.tar.gz -C ./miao/
Copy the code