Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

link

Creates a hard link to an existing file.

Creates a new directory entry NEWFILE that refers to the same inode as OLDFILE. Both paths must be on the same filesystem. The link count of the file is incremented. Uses std::fs::hard_link. Returns 1 on success, 0 on failure (and sets $!).

Synopsis

link $oldfile, $newfile or die "Cannot link: $!";
link '/data/original', '/data/hardlink';

See Also

symlink, unlink, rename