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