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

The difference between ln soft links and hard links

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

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

How to create a software link: # ln-s source file target file

How to create hard links: # ln source file target file

Characteristics of hard links

1. Hard-linked files have the same inode node number

two。 Delete the hard link file or delete one of the source files, the file entity has not been deleted

3. The file entity will be deleted only if the source file and all corresponding hard-linked files are deleted.

4. When all hard-linked files and source files are deleted, the new file created takes up space in the file.

5. Modify any hard link file, and all associated hard link files and source files will be modified at the same time.

6. You can prevent important files from being mistakenly deleted by setting hard-linked files.

7. When the number of hard-linked file connections to a file is 0, the file is deleted (the third column of ls-l is the number of hard-linked links)

8. Directories cannot create hard links

Characteristics of soft links:

1. Soft links, also known as symbolic links, are equivalent to shortcuts in windows, and the file type is l

two。 A soft link is similar to a text file in which the path of the source file is stored and points to the source file entity.

3. Delete the source file, the soft link file still exists, but the contents of the source file path cannot be accessed

4. Soft links are different types of files, different files, and different inode numbers

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

Network Security

Wechat

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

12
Report