Linux-File compression and Archiving

Source: Internet
Author: User

1. Compression formats: gz, bz2, xz, zip, and Z
 
Ii. compression algorithms: different algorithms and different compression ratios

Iii. commands:
1. gzip: generate a. gz compressed file. Only files can be compressed. After compression or decompression is completed, the original file will be deleted.
Format: gzip/PATH/TO/SOMEFILE:
-D: Extract
-#: 1-9. Specify the compression ratio. The default value is 6;
Decompress gunzip/PATH/TO/SOMEFILE.gz
Zcat/PATH/TO/SOMEFILE.gz: Check the content of the text file.

2.bzip2: Generate. bz2 compressed file. Only files can be compressed. After compression or decompression is completed, the original file will be deleted. A compression tool with a greater compression ratio than gzip uses an approximate format.
Format: bzip2/PATH/TO/SOMEFILE
-D: Extract
-#: 1-9; default value: 6
-K: the original file is retained during compression.
Bunzip2/PATH/TO/SOMEFILE.bz2 unzip
Bzcat: Check the content of a text file without any pressure
 
3. xz: generate a. xz compressed file. Only files can be compressed. After compression or decompression is completed, the original file will be deleted.
Format: xz/PATH/TO/SOMEFILE
-D: Extract
-#: 1-9; default value: 6
-K: the original file is retained during compression.
Unxz: Extract
Xzdec: view the content of a text file without any pressure
Xzcat: view the content of a text file without any pressure

2. archive does not mean compression.
1. tar: archive tool that generates. tar archive files
-F FILE.tar: the archived file for the operation.
-Cf: Create an archive file
-Xf: Expand the archive
-- Xattrs: retains the extended attributes of an object during archiving.
-T: You can directly view the archived files without expanding the archive.
-Zcf: Archive and call gzip Compression
-Zxf: Call gzip to decompress and archive. The-z option can be omitted.
-Jcf: bzip2
-Jxf:
-Jcf: xz
-Jxf:
 
2. cpio: archiving Tool
 
3. zip: an archive and compressed Tool
Format: zip FILENAME.zip FILE1 FILE2... Do not delete the original file after compression
Decompress: unzip FILENAME.zip.

Linux archive compression and software management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.