📄 ln.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>ln</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_001_014_1156"> </a>NAME</h4><blockquote>ln - link files</blockquote><h4><a name = "tag_001_014_1157"> </a>SYNOPSIS</h4><blockquote><pre><code>ln <b>[</b>-f<b>] </b><i>source_file target_file</i>ln <b>[</b>-f<b>] </b><i>source_file</i>... <i>target_dir</i></code></pre></blockquote><h4><a name = "tag_001_014_1158"> </a>DESCRIPTION</h4><blockquote>In the first synopsis form, the<i>ln</i>utility will create a new directory entry (link) for thefile specified by the<i>source_file</i>operand, at the<i>destination</i>path specified by the<i>target_file</i>operand.This first synopsis form is assumed when the final operand does not namean existing directory;if more than two operands are specified and the finalis not an existing directory, an error will result.<p>In the second synopsis form, the<i>ln</i>utility will create a new directory entry for each file specified by a<i>source_file</i>operand, at a<i>destination</i>path in the existing directory named by<i>target_dir</i>.<p>If the last operand specifies an existing file of a type notspecified by the <b>XSH</b> specification, the behaviour is implementation-dependent.<p>The correspondingdestination path for each<i>source_file</i>will be the concatenation of thetarget directory pathname, a slash character, and the last pathname componentof the<i>source_file.</i>The second synopsis form will be assumed whenthe final operand names an existing directory.<p>For each<i>source_file</i>:<ol><p><li>If the<i>destination</i>path exists:<ol type = a><p><li>If the<b>-f</b>option is not specified,<i>ln</i>will write a diagnosticmessage to standard error, do nothing more with the current<i>source_file,</i>and go on to any remaining<i>source_files.</i><p><li>Actions will be performed equivalent to the <b>XSH</b> specification<i><a href="../xsh/unlink.html">unlink()</a></i>function, called using<i>destination</i>as the<i>path</i>argument.If this fails for any reason,<i>ln</i>will write adiagnostic message to standard error, do nothing more withthe current<i>source_file,</i>and go on to any remaining<i>source_files.</i><p></ol><p><li>Actions will be performed equivalent to the <b>XSH</b> specification<i><a href="../xsh/link.html">link()</a></i>function using<i>source_file</i>as the<i>path1</i>argument, and the<i>destination</i>path as the<i>path2</i>argument.<p></ol></blockquote><h4><a name = "tag_001_014_1159"> </a>OPTIONS</h4><blockquote>The<i>ln</i>utility supports the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b> </a> .<p>The following option is supported:<dl compact><dt><b>-f</b><dd>Force existing<i>destination</i>pathnames to be removedto allow the link.</dl></blockquote><h4><a name = "tag_001_014_1160"> </a>OPERANDS</h4><blockquote>The following operands are supported:<dl compact><dt><i>source_file</i><dd>A pathname of a file to be linked.This can be a regular or special file;whether a directory can be linked is implementation-dependent.<dt><i>target_file</i><dd>The pathname of the new directory entry to be created.<dt><i>target_dir</i><dd>A pathname of an existing directory in which the new directoryentries are to be created.</dl></blockquote><h4><a name = "tag_001_014_1161"> </a>STDIN</h4><blockquote>Not used.</blockquote><h4><a name = "tag_001_014_1162"> </a>INPUT FILES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_1163"> </a>ENVIRONMENT VARIABLES</h4><blockquote>The following environment variables affect the execution of<i>ln</i>:<dl compact><dt><i>LANG</i><dd>Provide a default value for the internationalisation variablesthat are unset or null.If<i>LANG</i>is unset or null, the corresponding value from theimplementation-dependent default locale will be used.If any of the internationalisation variables contains an invalid setting, theutility will behave as if none of the variables had been defined.<dt><i>LC_ALL</i><dd>If set to a non-empty string value,override the values of all the other internationalisation variables.<dt><i>LC_CTYPE</i><dd>Determine thelocale for the interpretation of sequences of bytes of text data ascharacters (for example, single- as opposed to multi-byte charactersin arguments).<dt><i>LC_MESSAGES</i><dd>Determine the locale that should be used to affectthe format and contents of diagnosticmessages written to standard error.<dt><i>NLSPATH</i><dd>Determine the location of message cataloguesfor the processing of<i>LC_MESSAGES .</i></dl></blockquote><h4><a name = "tag_001_014_1164"> </a>ASYNCHRONOUS EVENTS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_1165"> </a>STDOUT</h4><blockquote>Not used.</blockquote><h4><a name = "tag_001_014_1166"> </a>STDERR</h4><blockquote>Used only for diagnostic messages.</blockquote><h4><a name = "tag_001_014_1167"> </a>OUTPUT FILES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_1168"> </a>EXTENDED DESCRIPTION</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_1169"> </a>EXIT STATUS</h4><blockquote>The following exit values are returned:<dl compact><dt>0<dd>All the specified files were linked successfully.<dt>>0<dd>An error occurred.</dl></blockquote><h4><a name = "tag_001_014_1170"> </a>CONSEQUENCES OF ERRORS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_1171"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_1172"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_1173"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_1174"> </a>SEE ALSO</h4><blockquote><i><a href="chmod.html">chmod</a></i>,<i><a href="find.html">find</a></i>,<i><a href="pax.html">pax</a></i>,<i><a href="rm.html">rm</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -