S6-LN(1)

NAME
s6-ln - create a link to a file

SYNOPSIS
s6-ln [-n] [-s] [-f] [-L] [-P] source target

DESCRIPTION
s6-ln acts as the generic ln [1] utility.

OPTIONS

-s  Create a symbolic link instead of a hard link.

-f  Force replacement of an existing target.

-L  Link targets of symlinks in source....

-P  Link symlinks in source... themselves.

-n  If target is a symlink to a directory, replace it instead of adding a link in the directory.

EXIT STATUS

111 Temporary error.

100 Permanent error, such as a misuse.

127 Unable to execute program - not found.

126 Unable to execute program - other reason.

SEE ALSO
s6-basename(1), s6-cat(1), s6-chmod(1), s6-chown(1), s6-clock(1), s6-cut(1), s6-dirname(1), s6-dumpenv(1), s6-echo(1), s6-env(1), s6-expr(1), s6-false(1), s6-format-filter(1), s6-grep(1), s6-head(1), s6-hiercopy(1), s6-linkname(1), s6-ls(1), s6-maximumtime(1), s6-mkdir(1), s6-mkfifo(1), s6-nice(1), s6-nuke(1), s6-pause(1), s6-printenv(1), s6-quote(1), s6-quote-filter(1), s6-rename(1), s6-rmrf(1), s6-seq(1), s6-sleep(1), s6-sort(1), s6-sync(1), s6-tai64ndiff(1), s6-tail(1), s6-touch(1), s6-true(1), s6-uniquename(1), s6-unquote(1), s6-unquote-filter(1), s6-update-symlinks(1), seekablepipe(1)

[1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ln.html

This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6-portable-utils/s6-ln.html

STANDARDS
s6-ln would be suitable as a ln [1] program conforming to susv4 / p1003.1-2008, except that POSIX mandates that a preexisting target must first be unlink(2) ed and then link(2) ed / symlink(2) ed, which prevents atomic replacements.

s6-ln aims to be reliable and allow for atomic replacements, so it deviates from POSIX on that point: when target exists and needs to be replaced, s6-ln first creates a (sym)link to a unique temporary name, then rename(2) s the temporary name to target. This behaviour makes sure that target is atomically replaced - there's no point in time where it does not exist.

AUTHORS
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)