{
  "slug": "unlink",
  "term": "Unlink",
  "aliases": [
    "unlink()"
  ],
  "definition": "Unlink is the removal of a directory entry that names a file, without invalidating the file's other hard links or existing open references.",
  "note": "Linux unlink() removes a name; if that was the last hard link, existing open references can keep the file usable after its pathname disappears. Reclamation depends on releasing the remaining references, not merely removing one pathname. A symbolic-link argument removes the symbolic link itself, not its target. Plain unlink() does not remove directories; unlinkat() with AT_REMOVEDIR requests directory removal instead. Namespace removal is not secure erasure or proof of crash-persistent deletion.",
  "advantages": [
    "Allows a name to be removed without interrupting existing users of the open file."
  ],
  "limitations": [
    "Other hard links and open references can preserve the file after the name is removed.",
    "Does not promise physical erasure or persistent deletion after a crash."
  ],
  "related": [
    "inode",
    "hard-link",
    "atomic-rename",
    "open-file-description",
    "directory-fsync"
  ],
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-15",
  "citations": [
    {
      "id": "linux-unlink-2",
      "title": "Linux man-pages 6.19: unlink(2)",
      "url": "https://man7.org/linux/man-pages/man2/unlink.2.html",
      "accessed": "2026-10-15"
    },
    {
      "id": "linux-open-2",
      "title": "Linux man-pages 6.19: open(2)",
      "url": "https://man7.org/linux/man-pages/man2/open.2.html",
      "accessed": "2026-10-15"
    },
    {
      "id": "linux-fsync-2",
      "title": "Linux man-pages 6.19: fsync(2)",
      "url": "https://man7.org/linux/man-pages/man2/fsync.2.html",
      "accessed": "2026-10-15"
    },
    {
      "id": "hesela-namespace",
      "title": "Hesela: The name changes; existing readers do not",
      "url": "https://hesela.com/analyses/atomic-rename-directory-durability/#namespace-identity",
      "accessed": "2026-10-15"
    }
  ]
}
