LN(1) General Commands Manual LN(1)

lncreate hard links and symbolic links

ln [-fnv] [-L|-P] source... target

ln -s [-fn] reference... target

ln create links at target for each given source or reference.

When target is an existing directory or multiple source or reference are given, ln will create links into target.

Should be noted that unlike commands like cp(1), reference is kept as is and therefore is always relative to target rather than the current directory.

Forcefully create links by removing existing entries.
If source is a symbolic link, dereference it.
Prevent descending into target as a directory if it is a symbolic link.
If source is a symbolic link, hard link it. This is the default.
Create symbolic links instead of hard links.
Print successfully created links.

The ln utility exits 0 on success, and >0 if an error occurs.

ln should be compliant with the IEEE Std 1003.1-2024 (“POSIX.1”) specification. The -n and -v options are extensions.

Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>

2024-04-28 Linux 6.6.67-gentoo-x86_64