Hard link

In computing, a hard link is a directory entry (in a directory-based file system) that associates a name with a file. Thus, each file must have at least one hard link. Creating additional hard links for a file makes the contents of that file accessible via additional paths (i.e., via different names or in different directories).[1] This causes an alias effect: a process can open the file by any one of its paths and change its content. By contrast, a soft link or “shortcut” to a file is not a direct link to the data itself, but rather a reference to a hard link or another soft link.

Every directory is itself a special file on many systems, containing a list of file names instead of other data. Hence, multiple hard links to directories are possible, which could create a circular directory structure, rather than a branching structure like a tree. For that reason, some file systems forbid the creation of additional hard links to directories.

POSIX-compliant operating systems, such as Linux, Android, macOS, and the Windows NT family,[2] support multiple hard links to the same file, depending on the file system. For instance, NTFS and ReFS support hard links,[3] while FAT does not.

  1. ^ Pitcher, Lew. "Q & A: The difference between hard and soft links".
  2. ^ "Link Shell Extension".
  3. ^ "Resilient File System (ReFS) overview". Microsoft Learn. 26 October 2022 – via Microsoft Docs.

© MMXXIII Rich X Search. We shall prevail. All rights reserved. Rich X Search