link

creates a hard link between files

TLDR

Create hard link
$ link [target] [linkname]
Link file to directory
$ link [file.txt] [dir/file.txt]

SYNOPSIS

link file1 file2

DESCRIPTION

link creates a hard link between files. Unlike ln, it only creates hard links and takes exactly two arguments.The tool creates an additional directory entry pointing to the same inode. Both names reference the same file data.

PARAMETERS

FILE1

Target file (source).
FILE2
Link name (destination).

INSTALL

sudo apt install coreutils
sudo dnf install coreutils
sudo pacman -S coreutils
sudo apk add coreutils
sudo zypper install coreutils
brew install coreutils
nix profile install nixpkgs#coreutils

CAVEATS

Cannot create symbolic links. Cannot link directories. Target must exist. Same filesystem only.

HISTORY

link is a POSIX utility providing a simple interface to the link() system call for creating hard links.

SEE ALSO

ln(1), unlink(1), readlink(1)