Use the tar command in CentOS7 to decompress the file

Source: Internet
Author: User

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.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.