ln appeared in Issue 2 of the X/Open Portability Guidelines.6 The version of ln bundled in GNU coreutils was written by Mike Parker and David MacKenzie.7 The command is available as a separate package for Microsoft Windows as part of the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities.8 The ln command has also been ported to the IBM i operating system.9
Links allow more than one filename to refer to the same file as in the case of a hard link or act as pointers to a filename as in the case of a soft link. Both hard links and soft links can be created by the ln command. Specifically,
The ln utility on systems compliant with the Single Unix Specification is specified in the Shell and Utilities (XCU) document, which forms a part of the Single Unix Specification.17 A mostly identical document is part of POSIX.18
The specification describes two ways of invoking the ln utility. Specifically,
The specification also specifies the command line options that must be supported:
If neither target file nor target directory are specified, links will be created in the current working directory.
Kernighan, Brian W.; Pike, Rob (1984). The Unix programming environment. Englewood Cliffs, N.J.: Prentice-Hall. p. 59. ISBN 013937681X. 013937681X ↩
"GNU Coreutils: ln invocation". gnu.org. Free Software Foundation, Inc. Retrieved 7 August 2015. https://www.gnu.org/software/coreutils/manual/html_node/ln-invocation.html ↩
"ln - The Open Group Base Specifications Issue 7". pubs.opengroup.org. The IEEE and The Open Group. Retrieved 7 August 2015. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ln.html ↩
"Why are hard links not allowed to directories in UNIX/Linux?". unix.stackexchange.com. Retrieved 7 August 2015. http://unix.stackexchange.com/questions/22394/why-hard-links-not-allowed-to-directories-in-unix-linux?rq=1 ↩
ln – Shell and Utilities Reference, The Single UNIX Specification, Version 4 from The Open Group https://pubs.opengroup.org/onlinepubs/9799919799/utilities/ln.html ↩
ln(1) – Linux General Commands Manual https://www.mankier.com/1/ln ↩
"Native Win32 ports of some GNU utilities". unxutils.sourceforge.net. http://unxutils.sourceforge.net/ ↩
IBM. "IBM System i Version 7.2 Programming Qshell" (PDF). IBM. Retrieved 2020-09-05. /wiki/IBM ↩
Loosemore, Sandra; Stallman, Richard M.; McGrath, Roland; Oram, Andrew; Drepper, Ulrich. The GNU C Library Reference Manual (PDF). Free Software Foundation, Inc. p. 392. Retrieved 7 August 2015. https://www.gnu.org/software/libc/manual/pdf/libc.pdf ↩
"Speaking UNIX: It is all about the inode". ibm.com. IBM developerWorks. Retrieved 7 August 2015. http://www.ibm.com/developerworks/aix/library/au-speakingunix14/ ↩
Bovet, Daniel P.; Cesati, Marco (2005). Understanding the Linux Kernel (3rd ed.). Boston, MA: Safari Tech Books Online. p. 14. ISBN 0596005652. 0596005652 ↩
"readlink(1) - Linux man page". linux.die.net. Retrieved 7 August 2015. http://linux.die.net/man/1/readlink ↩
"The Single UNIX Specification, Version 4 - Overview". unix.org. unix.org. Retrieved 7 August 2015. http://www.unix.org/version4/overview.html ↩