We often encounter packages packaged in. gz format, which is not an executable automatic installation package, which is equivalent to a ZIP package, which is the process of manually extracting, editing, configuring environment variables. You can compress a GZ file by using the following command:
Tar zxvf <.gzfile>
<.gzfile> refers to the file that you need to decompress.
Parameter description:
Z-to filter the gzip file, that is, only the specified GZ format file can be decompressed.
X-Unzip (tar can also be compressed to view and package, so if you need to unpack the package, you need to specify X on the command line)
V-Shows the decompression process in verbose mode.
F-Specify the uncompressed file
For example, unzip the JDK file. We download a file jdk-8u73-linux-x64.tar.gz from the Oracle official website, and then we need to extract the file to/opt/java/.
Su root ... (Input password for authentication) mkdir/opt/java/#create a folder called "Java" before tar extracts file.cd/opt/ Javatar zxvf/home/john/software/jdk-8u73-linux-x64.tar.gz
At the end of the execution, you will find a folder jdk1.8.0_73 in the/opt/java directory.
CentOS7 using the tar command to extract the files