Linux LN Soft and hard link commands

Source: Internet
Author: User
Tags rabbitmq

ln

Command: Create a synchronized link to a file or directory in another location, similar to a hyperlink under Windows, and change the other file regardless of the change.

Use:

ln [-S] source file directory or location destination file directory or location

Example:

Ln-s/USR/LOCAL/RABBITMQ-SERVER-3.6.6/OPT/RABBITMQ

/OPT/RABBITMQ the directory to/usr/local/rabbitmq-server-3.6.6,

So when I visit the/OPT/RABBITMQ directory, it's equivalent to accessing the/usr/local/rabbitmq-server-3.6.6 directory.

Delete Link: rm-rf/opt/rabbitmq-use RM command.

Soft links and Hard links

A hard link means that a file can have multiple names, whereas a soft link creates a special file with the content of the file pointing to the location of another file.

Hard links exist in the same file system, but soft links can span different file systems.

Soft Links:

1. Soft links, in the form of a path exists. Similar to shortcuts in the Windows operating system
2. Soft links can cross file system, hard links can not
3. Soft links can link to a nonexistent file name
4. Soft links can be linked to the directory

Hard Links:

1. Hard link, in the form of a copy of the file. But does not occupy the actual space.
2. Do not allow the creation of hard links to the directory
3. Hard links can only be created in the same file system

Linux LN Soft and hard link commands

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.