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.


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:

make a backup of each existing destination file
ln --backup[ ...
like --backup but does not accept an argument
ln -b ...
allow the superuser to attempt to hard link directories (note: will probably fail due to system restrictions, even for thesuperuser)
ln -d ...
remove existing destination files
ln -f ...
prompt whether to remove destinations
ln -i ...
dereference TARGETs that are symbolic links
ln -L ...
treat LINK_NAME as a normal file if it is a symbolic link to a directory
ln -n ...
make hard links directly to symbolic links
ln -P ...
create symbolic links relative to link location
ln -r ...
make symbolic links instead of hard links
ln -s ...
override the usual backup suffix
ln -S ...
specify the DIRECTORY in which to create the links
ln -t ...
treat LINK_NAME as a normal file always
ln -T ...
print name of each linked file
ln -v ...
display this help and exit
ln --help ...
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 ...
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 ...
AUTHORWritten by Mike Parker and David MacKenzie.REPORTING BUGSGNU coreutils online help: <>Report ln translation bugs to <>COPYRIGHTCopyright © 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <>.This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
ln -P. ...