In this article
Matching contents alone do not establish that two paths are hard links. This matters when a duplicate finder or a storage investigation presents two files that appear interchangeable. Before choosing what to remove, distinguish the names you see from the file they identify. You do not need to delete either one to investigate that relationship.
Check identity before changing a file
For two ordinary files you own, open Terminal and run the following read-only command, replacing the example paths with their actual absolute paths:
/usr/bin/stat -f '%N device=%d inode=%i links=%l' "/path/to/first.txt" "/path/to/second.txt"
You can drag each file from Finder into Terminal to insert its path instead of typing a long location. Keep the format string and both file arguments intact. Check the paths before pressing Return.
Compare device and inode together. Inode numbers identify files within a filesystem; the number alone is not a cross-volume identity. For two hard links to one ordinary file, both fields match. The link count reports how many directory entries refer to that file.
A matching size, name, modification time or content hash answers a different question. Two independent files can contain identical bytes. Conversely, the same hard-linked file can be reached under different names in different folders.
Keep this inspection scoped to ordinary files. A Finder alias, a symbolic link, a cloud placeholder or an app-managed package introduces other details. If Finder identifies the item as an alias, use the alias-versus-original checklist first.
There is no privileged “original” name
Apple’s archived link system-call manual describes the new path as another directory entry with equal access to the underlying object. The names must be on the same filesystem. Removing the first path does not remove the second.
“Original” can describe which name you created first, but it does not give that name special ownership over the others. A hard link is therefore different from a shortcut that depends on finding an original at another location.

Source: Apple Developer — link(2), captured November 3, 2026. The archive describes the API; the following test checks the behavior on the Mac used for this article.
This is also different from an APFS clone. Clones have separate file identities even when they share storage blocks. Two hard links name the same file identity. “Uses shared storage” is too broad a description to distinguish them.
Our test: one file, two names, then one name
On November 3, 2026, we created a small text fixture on macOS 15.7.5. It contained amber followed by a newline. We used the operating system’s hard-link operation to add a second name, then recorded both paths’ identity and contents.
We next wrote coral through the second path without replacing the file. Finally, we removed the first path with an unlink operation. No personal documents, application files or libraries were involved.
| Stage | First path | Second path |
|---|---|---|
| Hard link created | Inode 56626438, links 2, amber | Inode 56626438, links 2, amber |
| In-place write through second path | Same inode, coral | Same inode, coral |
| First path unlinked | Path absent | Same inode, links 1, coral |
The shared write and the surviving second name answer two separate questions. Writing through one name changed the one underlying file. Removing one name reduced the number of names without destroying the remaining path.
These inode numbers are observations from this fixture, not values to expect on your Mac. The test did not measure reclaimed disk space, simulate an application uninstaller or establish what a particular editor does when saving.
Why a save can make the names diverge
“Editing a hard link changes all its names” needs one qualification: which filesystem operation did the editor perform?
For a second phase, we restored the first hard link, created a separate temporary file containing indigo, and replaced the first path with that temporary file. We did not write into the existing shared file.
After replacement:
- The first path identified inode 56626442, contained
indigo, and had one link. - The second path still identified inode 56626438, contained
coral, and had one link.
The replacement changed which file the first name identified. It did not rewrite the old file still reached by the second name. This is why hard links are not a dependable general-purpose synchronization system for documents edited by arbitrary applications.
An editor can save by writing into a file or by creating and replacing one. Our fixture demonstrates the distinction between those operations; it does not claim that every application chooses the same method. If that behavior matters to your workflow, test the particular application with disposable sample documents and compare identity after saving.
What this means for cleanup and backups
A hard link is not an independent backup. In our in-place-write test, both paths exposed the changed contents because there was only one file. Keeping a second name did not preserve the earlier version.
Some tools deliberately use hard links. For example, MacPaw documents Gemini 2’s duplicate-to-hard-link option. That vendor documentation explains its own feature and restrictions; it is not a reason to convert an app library manually or assume every apparent duplicate is hard-linked.
Before removing anything:
- Identify the path you still need. A project or application may expect a particular location even when another name reaches the same data.
- Verify the relationship. Compare device and inode for the exact ordinary files, rather than relying on visual similarity.
- Keep an independent backup when the data matters. Another hard link does not isolate in-place changes.
- Separate Trash from unlinking. Moving an item to Trash can move its directory entry; it is not the same operation as the unlink step in our test.
- Avoid promising storage savings. Removing one of several hard links leaves the file needed by the remaining names.
Apple’s unlink manual also distinguishes removing the last link from releasing a file that a process still has open. Our deleted-but-still-open file guide covers that separate case.
The useful decision is which path your workflow no longer needs. Establish identity and preserve the data you intend to keep before using deletion as a cleanup action.


