Centos(102.16-tar.gzunpack and the symbolic chain, centos-tar.gz

Source: Internet
Author: User
Tags gz file

Centos(102.16-tar.gzunpack and the symbolic chain, centos-tar.gz

You can use raror zipping To uncompress the installation program in windows. centos also has various types of files. This article will introduce the most common tar.gz files.

Tar.gz

Gz Suffix: A file compressed using the gzip command. It refers to a compressed file that is not packaged.

Tar Suffix: package file generated using the tar command. It refers to the package file of multiple files, but it is not compressed.

Tar.gz Suffix: Files packaged with tar and compressed with gzip.

Download jdk.tar.gz

After downloading it, use winscp to copy it to centos. You can also use wget to download it, but you must first find the final one, as mentioned in article 4.

Unwrap jdk.tar.gz

Now we use normal users, and wb is a normal user created by me. Red is the tar.gz file.

Tar-xf jdk-8u151-linux-x64.tar.gz-C/home/wb: unpack the tar.gz file to the/home/wb directory

Tar is a package command.

-X is the unpacking option.

-F refers to the file source. Note that this option is placed at the end, followed by the file name.

-C is the directory stored after unpacking. It must be an existing Directory. Without this option, the package is unwrapped to the current directory by default. In fact, what I specified is the current directory.

Note: I have deleted the jdk installed with rpm in advance. After unpacking, the java command cannot be executed directly.

Create a java Symbolic Link

There are multiple methods to make the java command take effect. In the previous article, we added the jdk bin directory to the PATH. Now we want to talk about setting up a link in the existing PATH to point to the jdk bin directory, this method is simpler and safer, which is also automatically implemented by rpm when jdk is installed. If you do not understand the PATH, you must first understand the previous article.

Echo $ PATH: the last two directories are the dedicated paths of common users. The default PATH does not exist. You need to manually create this directory, mkdir/home/wb/bin.

Ln-s/home/wb/jdk1.8.0 _ 151/bin/*/home/wb/bin /: create a symbolic link for all files in the/home/wb/jdk1.8.0 _ 151/bin directory and save it to the/home/wb/bin/directory. * Indicates all files.

Ln: creates a link file. The default value is hard link, which is not discussed here.

-S: Creates a symbolic link instead of a default hard link. A Symbolic Link is equivalent to a shortcut in a window. Because it corresponds to a hard link, it is also called a soft link.

For example, the PATH does not change, and too many paths are not conducive to management. Finally, check the/home/wb/bin directory, and find that all these are link files and point to the bin directory of jdk.

When you execute the java command, first find the java link file in/home/wb/bin according to the PATH, and then find the installed java file through the link.

Related Article

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.