Linux hard links and soft links

Source: Internet
Author: User
Hard Link Concepts

A hard link, also called a link, is one or more filenames of a file

After the hard link is established, the source file and the link file are synchronized, and any one of the files will be modified.

Create links to save space, just maintain link relationships and don't need to copy files

the essential difference between hard and soft links a hard link can be thought of as a file with two filenames, whereas a soft link is a system that creates a new linked file that points to the limitations of hard links to the files it refers to.
  • Soft links can cross file systems; hard links cannot be
  • Soft links can be linked to a nonexistent file; hard links cannot be
  • Soft links can be connected to the directory, hard links can not

Soft links overcome the limitations of hard links. Based on this, focus on soft links. A soft link is also called a symbolic link, which is equivalent to a shortcut in Windows.

Create a soft link
Ln -S src_file  Ln_file
Remove soft Links
RM Ln_file

Note : For catalog soft Practice level

RM Ln_dir is to remove soft links

RM ln_dir/is the deletion of files in directory Ln_dir, of course, the files in the source directory will also be deleted (synchronous)

Linux hard links and soft links

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.