Use the tar command in CentOS7 to decompress the file
Linux: centos7,we often encounter compressed packages in the .gz format. This package is not an executable automatic installation package. This package is equivalent to a zip package, the installation process is the process of manually extracting, editing the configuration file, and configuring environment variables.
Use the following command to compress a gz file:
Tar zxvf <. gzfile>
<. Gzfile> indicates the file to be decompressed.
Parameter description:
Z-filter gzip files, that is, only files in the specified gz format can be decompressed.
X-extract (tar can also view and package compressed packages. Therefore, if you need to decompress the file package, you must specify x in the command line)
V-the decompression process is displayed in detail mode.
F-specifies the file to be decompressed
Decompress the jdk file as an example. Download a jdk-8u73-linux-x64.tar.gz file from the oracleofficial network. Then, decompress 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/Java
Tar zxvf/home/John/Software/jdk-8u73-linux-x64.tar.gz
After the execution is complete, you will find a folder jdk1.8.0 _ 73 added in the/opt/Java directory.