An explanation of LN commands under Linux

Source: Internet
Author: User

sudo ln-s source file destination file

The current directory is/local, and I often want to visit/usr/local/linux/work

Then I can use to create a file in the local linkwork,

Then sudo ln-s/usr/local/linux/work/local/linkwork

The link between the two is established.

Delete link

RM-RF symbolic_name Note not rm-rf symbolic_name/Then I'm rm-rf/local/linkwork. There are two types of links, one called hard link, and the other is called Symbolic link (symbolic link). When a hard link is established, the linked file and the linked file must be in the same file system, and a hard link to the directory cannot be established. For symbolic links, there is no such problem. By default, LN produces a hard link.
In the case of a hard link, the "target" in the parameter is linked to [link name]. If the [link name] is a directory name, the system will create one or more linked files with the same name as "target" in this directory, the link file and the contents of the linked file are identical. If the [link name] is a file, the user will be told that the file already exists and is not linked. If more than one target parameter is specified, the last parameter must be a directory.
If you add the-s option to the LN command, the symbolic link is established. If the [link name] already exists but is not a directory, the link will not be made. A link name can be either a file name (which can contain a path) or a directory, and it is allowed to be in a file system other than "target". If the [link name] is a directory that already exists, the system will establish one or more files with the same name as "target" in this directory, which is actually a symbolic link file pointing to the original "target".

An explanation of LN commands under Linux

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.