The ln command is a synchronous link for a file, and LN has two types of soft connections and one for hard links. A hard link means that a file can have multiple names, whereas a soft link creates a special file with the content of the file pointing to the location of another file. Hard links exist in the same file system, but soft links can span different file systems. A soft connection is similar to a shortcut to the current file, does not occupy space, a hard link is a copy of the current file, the size is the same as the source file, the changes are synchronized.
Here are a few to note that hard links do not work on the folder, the other hard links can not boast the file system.
Example 1
ln a.txt atxtlinkln-s a.txt atxtlinklnsyn-rw-r--r--2 xxx users 06-18 22:31 a.txt-rw-r--r--2 XXX Users 06-18 22:31 atxtlinklrwxrwxrwx 1 xxx users 5 08-19 21:17 Atxtlinklnsyn-a.txt
When the source file is deleted, the hard-link file is still in, the soft-connected file is not open
-rw-r--r--1 xxx users 06-18 22:31 atxtlinklrwxrwxrwx 1 xxx users 5 08-19 21:17 Atxtlinklnsyn-> ; A.txt
After rebuilding the source file, the soft link is not flashing prompt, indicating that the link file system has been linked successfully, after rebuilding, the hard link file is not affected by the source file, the contents of the hard-linked file or the content of the source file before the deletion, indicating that the hard link is invalid
Example 2 to create a soft connection to a folder, where-V indicates that the details are displayed, the directory creation link must be in absolute path, relative path creation will not succeed, will prompt: The number of layers of the symbolic connection too many errors
Ln-vs Test/testlink
Reference documents
Http://www.cnblogs.com/peida/archive/2012/12/11/2812294.html
Linux Command--ln command