Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are soft links and hard links?

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

What are soft links and hard links, respectively? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

I. hard links

Because the file under the Linux is identified by the index node (inode), the hard link can be thought of as a pointer to the file index node, and the system does not reassign the inode to it. Each time a hard link is added, the number of links to the file increases by 1.

Deficiency:

1. You cannot establish links between files of different file systems

2. Only superusers can create hard links for directories.

II. Soft links

Soft links overcome the shortcomings of hard links, without any file system limitations, any user can create symbolic links to directories. As a result, it is now more widely used, it has more flexibility, and it can even link files across different machines and different networks.

Deficiency:

Because the linked file contains the path information of the original file, so when the original file is moved from one directory to another directory, and then access the linked file, the system can not find it, and the hard link does not have this defect, you can move it as much as you want; and it requires the system to allocate additional space to build new Inodes and save the path of the original file.

In the actual scenario, soft links are basically used.

The difference between the two is as follows:

Hard links cannot cross partitions, and software chains can cross partitions.

A hard link points to an inode node, while a soft link creates a new inode node.

Delete the hard link file, will not delete the original file, delete the soft link file, will delete the original file.

The answers to the questions about soft links and hard links are shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report