CentOS7 using the tar command to extract the files

Source: Internet
Author: User
Tags gz file

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

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.