LinuxCommandLibrary

link

creates a hard link between files

TLDR

Create hard link

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

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).

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)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community