[LINUX] Features of symbolic and hard links

[Characteristics of symbolic and hard links]

Symbolic link

A symbolic link is one of the functions of the file system of an operating system (OS), and is a mechanism that creates another file that points to a specific file or directory so that the main body can be referenced through it. (IT Glossary e-Words)

Features </ strong>

-The inode used by the link file has a different number from the original file. ・ Link file can be created based on the directory -A link file can be created in a partition different from the original file. -At the beginning of the permission, "l" indicating a symbolic link file is displayed as the file type.

Hard link

A hard link refers to giving a name to the substance of a file (registering the name in a directory). Therefore, hard links are always possible except in situations where a file is created without a name.

(Multiple hard links can be created, and the same entity can be handled with another name, so it is compared with symbolic links.)

Features </ strong>

-Since the inode is the same, the inode number is naturally the same. -A directory can be a name of your choice and cannot be hard-linked as an alias. -Hard links of different partitions cannot be created because the file entity of another file system cannot be named. (Symlinks are name-based, not real, so filesystem differences don't matter.)

* Addition

angel_p_57 Thank you for politely pointing out the error.

Recommended Posts