Linux "ln" Command Line Options and Examples
make links between files

In the 1st form, create a link to TARGET with the name LINK_NAME. In the 2nd form, create a link to TARGET in the current directory. In the 3rd and 4th forms, create links to each TARGET in DIRECTORY.


Usage:

ln [OPTION]... [-T] TARGET LINK_NAME  (1st form)
ln [OPTION]... TARGET         (2nd form)
ln [OPTION]... TARGET... DIRECTORY   (3rd form)
ln [OPTION]... -t DIRECTORY TARGET... (4th form)






Command Line Options:

--backup[
make a backup of each existing destination file
ln --backup[ ...
-b
like --backup but does not accept an argument
ln -b ...
-d
allow the superuser to attempt to hard link directories (note: will probably fail due to system restrictions, even for thesuperuser)
ln -d ...
-f
remove existing destination files
ln -f ...
-i
prompt whether to remove destinations
ln -i ...
-L
dereference TARGETs that are symbolic links
ln -L ...
-n
treat LINK_NAME as a normal file if it is a symbolic link to a directory
ln -n ...
-P
make hard links directly to symbolic links
ln -P ...
-r
create symbolic links relative to link location
ln -r ...
-s
make symbolic links instead of hard links
ln -s ...
-S
override the usual backup suffix
ln -S ...
-t
specify the DIRECTORY in which to create the links
ln -t ...
-T
treat LINK_NAME as a normal file always
ln -T ...
-v
print name of each linked file
ln -v ...
--help
display this help and exit
ln --help ...
--version
output version information and exitThe backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the
ln --version ...
--backup
none, offnever make backups (even if --backup is given)numbered, tmake numbered backupsexisting, nilnumbered if numbered backups exist, simple otherwisesimple, neveralways make simple backupsUsing -s ignores -L and -P. Otherwise, the last option specified controls behavior when a TARGET is a symbolic link, defaulting to
ln --backup ...
-P.
AUTHORWritten by Mike Parker and David MacKenzie.REPORTING BUGSGNU coreutils online help: <http://www.gnu.org/software/coreutils/>Report ln translation bugs to <http://translationproject.org/team/>COPYRIGHTCopyright © 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
ln -P. ...