Differences between the two linux Connection Methods

Source: Internet
Author: User
Differences between the two linux connection methods-general Linux technology-Linux programming and kernel information. The following is a detailed description. Hard link: stores the same file in two places or uses two different file names.

Example:

# Ln/home/blond/music/duet.txt/home/elvis/music/duet.txt
# Ln/home/blond/music/duet.txt/home/blond/music/lkduet.txt

Soft link: assign two names to the same file.

Example: # ln-s/home/blond/music/duet.txt/home/elvis/music/rkduet.txt

The differences between the above two links:

1) after using ln to create a hard link, the two files have the same I-node, while using ln-s to create a soft link, the two files have different I-nodes, the format is as follows: llink-> lnfile;

2) hard links between directories can only be targeted at files, and soft links can be associated with directories and files;

3) hard links must be associated with files in the same file system. Soft links can also be associated with files in different file systems (partitions;

4) the original files with hard links can be moved and deleted. However, if the original files with soft links are deleted, null links or soft links become ineffective;

5) the chroot directory can share the link, but the soft link cannot reference files outside the chroot directory.

Note: view the file I-node, such:

# Ls-li/home/blond/music (file or 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.