Linux command to establish a soft connection

Linux soft link:
ln -s a/ /b #Soft link the contents of directory /a to directory b

ln a/ /b #Hard link

[hard link]
Hard link refers to the connection through the index node. In the Linux file system, no matter what type of file is stored in a disk partition, it is assigned a number called an inode number (Inode Index). In Linux, it is possible for multiple filenames to point to the same inode. Usually this connection is a hard connection. The role of the hard link is to allow a file to have multiple valid path names, so that the user can establish a hard link to an important file to prevent the function of "misdeletion". The reason for this is as described above, because there is more than one connection to the inode of the directory. Deleting only one connection does not affect the inode itself and other connections. Only when the last connection is deleted, the data block of the file and the connection of the directory will be released. That is, the condition for a file to be truly deleted is that all hard-linked files associated with it are deleted.

[Soft connection]
Another connection is called a symbolic link (Symbolic Link), also called a soft connection. Soft link files have Windows-like shortcuts. It is actually a special file. In a symbolic link, a file is actually a text file that contains information about the location of another file.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326746981&siteId=291194637