Linux commands: Creation, deletion, and update of Linux soft links---Ln

Source: Internet
Author: User

As we all know, sometimes we use links to make reference operations to save space. Similarly, there are also at the system level. In the Windows family, we call this a shortcut, and in Linux we call it a link (basically all the same, which may be different, but what about it?). As long as we realize our effect, who will have the energy to control it anise's anise word there are several ways to do it? )。

Windows old Maid of those several posture here will not repeat, we today mainly on the Linux anise in the anise word how to write. That's wrong, it's how the soft links in Linux work.

In Linux, links are divided into soft and hard, as for the difference between the two, we can refer to the next https://www.ibm.com/developerworks/cn/linux/l-cn-hardandsymb-links/

Link around the Ln/link command (of course, if you use a graphical interface, then you can just call it nonsense, you may close the current page directly). For an explanation of the commands in Ln, we'll talk about it later.

Create a soft link

Ln-s [ source file or directory] [destination file or directory]

For example:

Current path creation test leads to/var/www/test folder

Ln–s/var/www/test Test

Create/var/test to the/var/www/test folder

Ln–s/var/www/test/var/test

Remove soft Links

and delete normal files is a glance, delete is to use RM to operate

RM–RF Soft Link name (please note do not add "/" in the back, RM–RF after adding "/" difference, you can go to Baidu under AH)

For example:

Delete Test

RM–RF Test

Modify Soft Links

LN–SNF [ New source file or directory] [target file or directory]

This will change the original link address to the new address

For example:

Create a soft link

Ln–s/var/www/test/var/test

Modify a new path to a point

Ln–snf/var/www/test1/var/test

Well, basically the additions, deletions, and modifications are here.

-------------------------I have the depth of the split line------------------------

If you want to know more, you can ln–help to see the details.

Common parameters:

-B Delete, overwrite previously established link

-D allows super users to make hard links to directories

-F Force execution

-I interactive mode, file presence prompts the user whether to overwrite

-N Treats symbolic links as generic directories

-S soft link (symbolic link)

-V displays detailed processing procedures

(Current path creation test leads to/var/www/test folder)

Linux commands: Creation, deletion, and update of Linux soft links---Ln

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.