LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

ln

creates links between files

TLDR

Create symbolic link
$ ln -s [target] [linkname]
copy
Create hard link
$ ln [target] [linkname]
copy
Create symbolic link (force overwrite)
$ ln -sf [target] [linkname]
copy
Create link in directory
$ ln -s [target] [directory/]
copy
Create relative symbolic link
$ ln -sr [target] [linkname]
copy
Verbose output
$ ln -sv [target] [linkname]
copy

SYNOPSIS

ln [options] target linkname

DESCRIPTION

ln creates links between files. Hard links share the same inode; symbolic links are references.Symbolic links can span filesystems and link to directories. Hard links cannot.

PARAMETERS

TARGET

File or directory to link to.
LINKNAME
Name for the link.
-s
Create symbolic (soft) link.
-f
Force, overwrite existing.
-r
Create relative symbolic link.
-v
Verbose output.
-n
Don't dereference symlinks.
--help
Display help information.

INSTALL

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

CAVEATS

Hard links cannot cross filesystems. Symbolic links can break if target moves. Directory hard links not allowed.

HISTORY

ln is a traditional Unix command dating back to the original Unix system for creating links between files.

SEE ALSO

link(1), unlink(1), readlink(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid