Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Ln (Unix)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Use == Per the [[Single Unix Specification]], the {{code|ln}} command is specified in the Shell and Utilities (XCU) document.<ref name=SUSOverview>{{cite web|title=The Single UNIX Specification, Version 4 - Overview|url=http://www.unix.org/version4/overview.html|website=unix.org|publisher=unix.org|access-date=7 August 2015}}</ref> [[POSIX]] includes a similar specification.<ref name=SUS>{{man|1|ln|SUS}}</ref> If neither target file nor target directory are specified, links are created in the current [[working directory]]. ===Options=== The specification indicates command line options that must be supported: * {{code|-f}} (force) [[clobbering|Clobbers]] an existing file if the output path specifies an existing file * {{code|-L}} If a source operand specifies a symbolic link, create a hard link to the link's target file * {{code|-P}} If a source operand specifies a symbolic link, create a hard link to the symbolic link file * {{code|-s}} Create symbolic links instead of hard links; causes {{code|-L}} and {{code|-P}} to be silently ignored If more than one of the mutually-exclusive options {{code|-L}} and {{code|-P}} is specified, the last option specified determines the resulting behavior. If the {{code|-s}} option is not specified and neither a {{code|-L}} nor a {{code|-P}} option is specified, the implementation defines which of the {{code|-L}} and {{code|-P}} options is used by default. ===Single file invocation=== The command creates a new link to the path indicated by {{code|source}}; stored at the path indicated by {{code|target}}. The syntax is as follows: <syntaxhighlight lang="terminal"> ln [-fs] [-L|-P] source target </syntaxhighlight> ===Multiple file invocation=== The command creates a new link to each file specified by the {{code|source_#}} operands; stored in an existing directory indicated by {{code|target_dir}}. <syntaxhighlight lang="terminal"> ln [-fs] [-L|-P] source_1 source_2 ... target_dir </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)