We have explained the common three kinds of compression commands in the detailed parsing of compression commands in Linux (i), and we begin to explain the tar commands most commonly used in our work.
To make compression and decompression easier, the tar command came into being. So how exactly should we use it?
tar.gz format:
Compression command:
TAR-ZCVF compressed file name source file name
Example:
Compress the ABC file into a file with the suffix tar.gz format
TAR-ZCVF abc.tar.gz ABC
Decompression command:
Example: Unzip the abc.tar.gz file
TAR-ZXVF abc.tar.gz
TAR.BZ2 format:
Compression command:
Example: compressing an ABC file into a file with the suffix tar.bz2 format
TAR-JCVF abc.tar.bz2 ABC
Decompression command:
Example:
Unzip the abc.tar.bz2 file.
TAR-JXVF abc.tar.bz2
In particular:
① to compress the ABC file into the specified directory:
TAR-ZCVF/HOME/ABC.TAR.GZ ABC
Or
TAR-JCVF/HOME/ABC.TAR.GZ ABC
② extract the abc.tar.gz and abc.tar.bz2 into the/home directory:
TAR-ZXVF Abc.tar.gz-c/Home
Or
TAR-JXVF Abc.tar.bz2-c/Home
This article is from "Juzhou Youth" blog, please be sure to keep this source http://zhengkangkang.blog.51cto.com/12015643/1855030
Detailed parsing of compression commands in Linux (II.)