Get the App
SLTechnology News&Howtos  ›  Servers  › 

What is the difference between hardware link and software link in Linux system

Shulou Source: shulou.com Published: 2022-06-01 08:43:51 10月02日 Update

This article is to share with you about the difference between hardware links and software links in the Linux system. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

There are two ways of linking, one is hard link (Hard Link), the other is soft link or symbolic link (Symbolic Link).

1. Introduction to soft links:

1) A soft link exists in the form of a path to another file.

2) soft links can cross file systems, but hard links cannot.

3) A soft link can link a file name that does not exist, and a hard link must have a source file.

4) soft links can link directories.

5) deleting the soft link does not affect the file being pointed to, but if the original file is deleted, the relevant soft link becomes a dead link.

6) it is convenient for users to access under a simple path.

two。 Introduction to hard links:

1) hard links, in the form of a copy of the file. But it doesn't take up real space.

2) hard links to directories are not allowed.

3) hard links can only be created in the same file system.

4) deleting one of the hard-linked files does not affect other files with the same inode number.

Neither hard link nor soft link will make a copy of the original file and will only take up a very small amount of disk space.

Ln command format:

Ln [parameter] [source file or directory] [target file or directory]

Main parameters:

-I interactive mode, the presence of a file prompts the user whether to overwrite it.

-s soft links (symbolic links).

-d allows superusers to make hard links to directories.

-b delete, overwrite previously established links

1. Soft links (symbolic links) ln-s source target

two。 Hard links (physical links) ln source target

The above is the difference between hardware links and software links in Linux system. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Tags: Links files directories systems users symbols hardware software parameters forms pointing more knowledge space articles paths influences utility same copy Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Information Linux Apple Huawei