Atitit. Software gui button and panel --- OS zone ----- soft link, shortcut

Source: Internet
Author: User

Atitit. Software gui button and panel --- OS zone ----- soft link, shortcut

Atitit. Software gui button and panel --- OS zone ----- soft link, shortcut

1. Hard link 1

2. 2. Soft link (symbolic link) LN 1

3. Delete link 2

4. Difference 2

5. Reference 3

1. Hard Link

In the system, the kernel allocates an Inode (index node) to each newly created file, and each file has a unique inode number. The file attributes are stored in the index node. when accessing the file, the index node is copied to the inner to implement fast file access.

A link is a way to establish a connection between a shared file and several directory items of the users who access it. Linux contains two types of links: Hard Link and Soft Link. Soft link is also called Symbolic Link ). Symbolic connection is equivalent to a shortcut in Windows.

A hard link is a pointer pointing to a file index node, and the system does not re-allocate inode for it.

Although hard link saves space, it is also a traditional way for Linux to integrate file systems, but there are some shortcomings:
(1) cannot establish links between files in different file systems
(2) Only Super Users can create hard links for directories.

Author: old wow's paw Attilax iron, EMAIL: 1466519819@qq.com

Reprinted please indicate Source: http://blog.csdn.net/attilax

2. 2. Soft link (symbolic link) LN

Soft links overcome hard links without any restrictions on the file system. Any user can create symbolic links pointing to directories. As a result, it is more widely used. It has more flexibility and can even link files across different machines and networks.

Of course, soft links also have the disadvantage that hard links do not exist. Because the link file contains the path information of the original file, when the original file is moved from one directory to another, access the link file, the system cannot find it ~~, Hard links do not have this defect, so you need to move them as much as you want (haha). In addition, the system needs to allocate additional space for creating new index nodes and saving the original file path.

 

Mklink is a command tool for creating symbolic links and hard links in windows. It is a good tool for solving file system problems. Administrator privilege is required to use it.

The following figure shows how to create a symbolic link in windows. What are the differences between hard links and shortcuts.

Symbolic link)

· Run the command mklink link_name target_name.

· The icons and shortcuts after the link is created are similar.

· Do not occupy space in the system

· Not a separate file in the file system

· Parsing at the operating system layer (!?)

· If the source file is deleted, the link will be useless.

· Removing source files does not affect symbolic links.

· Removing a linked file does not affect the source file.

3. Delete links

If yes, it will be deleted.

Rm-rf symbolic_name note not rm-rf symbolic_name/

4. Differences

Soft links and hard links differ not only in terms of concept, but also in terms of implementation. Difference: A Public inode number is used for the hard-link original file and the linked file, indicating that they are the same file, while the soft-link original file and the linked file have different inode numbers, it indicates that they are two different files. On the file attributes, the soft link clearly writes the link file, but the hard link is not written, in essence, hard-link files are completely equal to the original files. The number of links is different, and the number of soft-link links does not increase. The file size is different, the size of the hard link file is the same as that of the original file. This is emphasized because it is equivalent, and the size of the soft link is different from that of the original file, the size of file1 is 48B, while that of file1soft is 5B, where 5 is actually the size of "file1.

Establish software connection LN-s in Linux

Ln-s/images_all/**/image_medium/home_src/**/public_html/images/medium

/Home_src/**/public_html/images/medium shocould not exist ....

If already exist, then to **/medium/image_medium

5. Reference

Differences between hard links, soft links, and shortcuts in Windows-heqichang-bok .htm

Create a soft link in windows, and junction's use of javas_tigeresta_sina blog .htm

Create and delete soft and hard links in linux-sauteed peanuts-blog garden .htm

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.