ln(link)
ln(link)功能说明:连接文件或目录。
语 法:ln [-bdfinsv][-S <字尾备份字符串>][-V <备份方式>][--help][--version][源文件或目录][目标文件或目录] 或 ln [-bdfinsv][-S <字尾备份字符串>][-V <备份方式>][--help][--version][源文件或目录...][目的目录]
补充说明:ln指令用在连接文件或目录,如同时指定两个以上的文件或目录,且最后的目的地是一个已经存在的目录,则会把前面指定的所有文件或目录复制到该目录中。若同时指定多个文件或目录,且最后的目的地并非是一个已存在的目录,则会出现错误信息。
参 数:
-b或--backup 删除,覆盖目标文件之前的备份。
-d或-F或--directory 建立目录的硬连接。
-f或--force 强行建立文件或目录的连接,不论文件或目录是否存在。
-i或--interactive 覆盖既有文件之前先询问用户。
-n或--no-dereference 把符号连接的目的目录视为一般文件。
-s或--symbolic 对源文件建立符号连接,而非硬连接。
-S<字尾备份字符串>或--suffix=<字尾备份字符串> 用"-b"参数备份目标文件后,备份文件的字尾会被加上一个备份字符串,预设的字尾备份字符串是符号"~",您可通过"-S"参数来改变它。
-v或--verbose 显示指令执行过程。
-V<备份方式>或--version-control=<备份方式> 用"-b"参数备份目标文件后,备份文件的字尾会被加上一个备份字符串,这个字符串不仅可用"-S"参数变更,当使用"-V"参数<备份方式>指定不同备份方式时,也会产生不同字尾的备份字符串。
--help 在线帮助。
--version 显示版本信息。
ln
ln [options] sourcename [destname] ln [options] sourcenames destdirectory
Create pseudonyms (links) for files
The first form links sourcename to destname, where destname is usually either a new filename or (by default) a file in the current directory with the same name as sourcename. If destname is an existing file, it is overwritten; if destname is an existing directory, a link named sourcename is created in that directory. The second form creates links in destdirectory, each link having the same name as the file specified.
Options
Back up any existing files. When using the long version of the command, the optional control parameter controls the kind of backup. When no control is specified, ln will attempt to read the control value from the VERSION_CONTROL environment variable. Accepted values are:
none, off Never make backups.
numbered, t Make numbered backups.
existing, nil Match existing backups, numbered or simple.
simple, never Always make simple backups.
Allow hard links
to directories. Available to privileged users.
Force the link (don't prompt for overwrite permission).
Print a help message and then exit.
Prompt for permission before removing files.
Replace symbolic links
to directories instead of dereferencing them. --force is useful with this option.
Create a symbolic link. This lets you link across filesystems, and also see the name of the link when you run ls -l (otherwise, there's no way to know the name that a file is linked to).
Append suffix to files when making backups, instead of the default ~.
Create links in the specified directory.
Verbose mode.
Print version information and then exit.