Linux soft link to create, delete, modify

Linux soft link, similar shortcut 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
1
[target directory] refers to the target directory soft link points to, soft links [address] refers to "shortcut" the 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 soft link [address]
1
above instructions, the address of the last soft link can not contain "/", when they contain "/", delete 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

Guess you like

Origin blog.csdn.net/weixin_34246551/article/details/90825952