hard link
An additional directory entry that points to an existing inode, so one file has two or more equal names.
In more detail
All hard links to a file are equal: editing through one name changes the data seen through the others, because there is only one inode. Creating one, with ln, increases the inode's link count; removing a name decreases it. This differs from a copy, which creates a second inode with independent data.
Example
The course record inode=42 names=report,archive links=2 shows one inode reached by two names.Related terms
- inode — The record a filesystem keeps for each file, holding its owner, mode, size, timestamps, link count and the location of its data blocks, but not its name.
- link count — The number stored in an inode that says how many directory entries point to it.
- directory entry — One line in a directory's table that maps a file name to an inode number.
- rm — The command that deletes files, and with -r whole directory trees, permanently.
Taught in
- Inodes, Hard Links And What rm Removes — Linux Fundamentals & Systems Administration
- Deploying Files: file, copy, lineinfile And blockinfile — RHCE in Ansible (EX294): Automate Red Hat Systems