Linux soft link to create, delete, modify

Linux soft link, similar shortcut keys windows system. For example, you will be certain D disk windows system folder on the desktop as a shortcut.
First, create a soft link
1, create a soft link

ln -s [target directory] [address] soft link

[] Refers to the target directory soft link pointing to the target directory, [address] refers to the soft links "shortcuts" file name, the file is being created instruction. The following example, the data in the original file public file does not exist, after the execution instruction exists. 
Example:

result:

 

2, create a soft link file under the same name does not need the same level directory. Like when you create a shortcut on the desktop windows system, the file can not have the same name.
When the same directory, when a file with the same name exist, an error will be reported as follows:

As the figure above data directory already have test files, it will complain.

Second, delete

rm -rf [address] soft link

above instruction, the address of the last soft link can not contain "/", when containing "/", the deletion of the resource under the soft link target directory, rather than the soft link itself.
Example:

Third, modify

ln -snf new target directory [] [] soft link address

here refers to modifications to modify the destination directory soft link
Example:

 

Guess you like

Origin www.cnblogs.com/xzlive/p/11125542.html