Archive operations are essentially "packaged", merging multiple files and directories into a single overall file for easy delivery or portability.
The compression operation can further reduce the disk space occupied by the packaged archive and improve the utilization of the backup media.
Linux The most commonly used compression command tools in the system include gzip , bzip2 , the most commonly used archive command tool is Tar . Using commands, you can automatically call gzip or bzip2with specific optionsto complete the archive compression process and, of course, complete the entire process of extracting and releasing archived files.
Use gzip The compressed file made by default has an extension of " . GZ ". When making compressed files, using the "-g" option can increase the compression ratio, but larger files will require more time.
when you need to decompress gzip compressed files, you only need to use the " - D "option of gzip command, or directly using the Gunzip command.
first make a $ trillion files
650) this.width=650; "title=" Image001.png "src=" http://s3.51cto.com/wyfs02/M01/40/00/ Wkiom1pnxqbtzy6yaadljydga4k289.jpg "alt=" Wkiom1pnxqbtzy6yaadljydga4k289.jpg "/>
Making compressed files and viewing compressed files
650) this.width=650; "title=" Image002.png "src=" http://s3.51cto.com/wyfs02/M02/40/00/ Wkiom1pnxrgqbkmraacuzbjqcjo309.jpg "alt=" Wkiom1pnxrgqbkmraacuzbjqcjo309.jpg "/>
Unzip the file
650) this.width=650; "title=" Image003.png "src=" http://s3.51cto.com/wyfs02/M00/40/00/ Wkiom1pnxrnygjs5aachupewjky689.jpg "alt=" Wkiom1pnxrnygjs5aachupewjky689.jpg "/>
bZIP and the Bunzip the use of commands and gzip , Gunzip commands are basically the same, using bzip2 commands are basically the same, using bzip2 The compressed file is made with the default extension " . bz2 ".
Making compressed Files
650) this.width=650; "title=" Image004.png "src=" http://s3.51cto.com/wyfs02/M02/40/01/wKioL1PNxj2TLPZ_ Aabws4mda5u652.jpg "alt=" Wkiol1pnxj2tlpz_aabws4mda5u652.jpg "/>
Unzip the file
650) this.width=650; "title=" Image005.png "src=" http://s3.51cto.com/wyfs02/M01/40/00/ Wkiom1pnxsrsd5egaacbjbr-fiw714.jpg "alt=" Wkiom1pnxsrsd5egaacbjbr-fiw714.jpg "/>
Tar archive and Release files
Tar commands are primarily used to archive directories and files. In the actual backup work, the package files are usually compressed at the same time as the archive to conserve disk space.
Tar options for the command (before the option " - " number can be omitted)
- C : Create . Tar package file in format
- C : Specifies the target folder to release when unpacking
- F : Indicates the use of an archive file
- I called bzip2 program to compress or decompress
- P Preserve file and directory permissions while packaging
- P keep absolute paths to files and directories while packaging
- T List view in-Package files
- v Output Details
- x untie . Tar package file in format
- Z called gzip program to compress or decompress
Making archived Backup files
tar [ options ] ... Archive and compress file names source files or directories that need to be archived
650) this.width=650; "title=" Image006.png "src=" http://s3.51cto.com/wyfs02/M00/40/01/wKioL1PNxkzzgcYzAADK_ Euyhwe542.jpg "alt=" Wkiol1pnxkzzgcyzaadk_euyhwe542.jpg "/>
tar [ options ] ... Archive and compress file names { - C target file }
650) this.width=650; "title=" Image007.png "src=" http://s3.51cto.com/wyfs02/M01/40/01/ Wkiol1pnxlrhwpaqaacedphi-f4229.jpg "alt=" Wkiol1pnxlrhwpaqaacedphi-f4229.jpg "/>
This article from "Plum blossom fragrance from bitter cold" blog, please be sure to keep this source http://wangjunkang.blog.51cto.com/8809812/1441196
Linux Archiving and compression