Common linux compression commands

Source: Internet
Author: User


Common linux compression commands (I) Principles of compression technology: -- Principle 1: Because 1 byte = 8 bits, each byte has eight memory units, and each memory unit can be 0, 1. When we record the number 1, seven bits should be "null ". However, to meet the needs of our current OS data access, we will convert the data into bytes for record. Some compression technologies are used to "resize" the space to reduce the space occupied by files. -- Principle 2: Record duplicate data. For example, if your data has 100 records, then the compression technology will record "100 1" instead of actually having 100 1 bits. Introduction to various compression commands www.2cto.com (ii) I gzip Syntax: gzip [-dv] File Name parameters:-d: extracted parameters-v: Show compression ratio example: [plain] [root @ localhost Desktop] # gzip show_space. SQL [root @ localhost Desktop] # gzip-d show_space. SQL .gz II bzip2 Syntax: bzip2 [-dkzv] file name parameter:-d: extract parameter-k: Keep source file-z: compress parameter-v: Show compression ratio example: [plain] [root @ localhost Desktop] # bzip2-z show_space. SQL [root @ localhost Desktop] # bzip2-d show_space. SQL .bz2 [root @ localhost Desktop] # bzip2-z The names of files packaged by k show_space. SQL www.2cto.com Ⅲ tar are different from those obtained by compression. For example, tar-cv-f file.tar. This file is called tarfile such as tar-jcv-f file.tar.bz2. This file is called tarball Syntax: compression: tar-jcv-f filename.tar.bz2: query the name of the file or directory to be compressed: tar-jtv-f filename.tar.bz2 decompression: tar-jxv-f filename.tar.bz2-C to be extracted, then change j to z to www.2cto.com. Example: [plain] [root @ localhost Desktop] # tar-jcv-f think.tar.bz2 show_space. SQL [root @ localhost Desktop] # tar-jxv-f think.tar.bz2-C/root/Desktop show_space. SQL IV syntax related to cipo and data stream redirection: backup: cpio-ovcB> [file | device] Restoration: cpio-ivcdu <[file | device] example: [plain] [root @ localhost Desktop] # find | cpio-ovcB>/home/oracle/desktop. cpio [root @ localhost Desktop] # cpio-idvc/home/think

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.