Common linux compression commands (I) Principles of compression technology: -- Principle 1: because 1byte8bit, eight memory units are contained in each byte, and each memory unit can be 0, 1. When we record the number 1, seven bits should be empty. However, to meet the requirements of our...
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
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