unlink · shipping · also unlink()

Unlink

Unlink is the removal of a directory entry naming a file; POSIX semantics preserve existing open references, while network-filesystem behavior requires additional qualification.

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. On ext4, orphan recovery completes pending reclamation after a crash; it does not establish whether an application's namespace change was durably synchronized. [5] [3] Removing and recreating a coordination-file name can let participants lock different files; a persistent name is part of the locking protocol, not disposable cleanup. [6] NFS requires a separate scope check: the Linux unlink manual documents active silly-renamed files as a possible EBUSY cause and warns about loss of access to files still in use. [1] See the NFS records for conditional server preservation. [7]

Relations

related
Inode, Hard link, Atomic rename, Open file description, Directory fsync, Ext4 orphan inode, Ext4 orphan file, Advisory file lock, NFS silly rename, NFS open-file preservation, Whiteout, Link count, Sticky bit

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.
  • Do not assume all NFS clients and servers preserve every remote open reference when a name is removed.

Citations

  1. Linux man-pages 6.19: fsync(2) (accessed 2026-10-15)
  2. Linux v6.12: ext4 orphan inode handling (accessed 2026-10-15)
  3. Hesela: A lock follows the opened file, not the replacement name (accessed 2026-10-16)

Further reading

  1. Linux man-pages 6.19: open(2) (accessed 2026-10-15)
  2. Hesela: The name changes; existing readers do not (accessed 2026-10-15)

JSON: /data/terms/unlink.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Unlink. Hesela. 2026-11-15. https://hesela.dev/terms/unlink/