Linux System Management-topic 02: Managing Files (1) _2.4 link files _ln

Source: Internet
Author: User

In Linux, there are two types of links: Symbolic links (symbolic link) and hard links.

? Deleting a symbolic link does not affect the target file or directory to which this symbolic link points;

? In turn, deleting, moving, or renaming a target file or directory pointed to by a symbolic link does not cause the symbolic link to be deleted, only causing the symbolic link to "break".

? If a file has multiple hard links, only the last hard link is deleted and the hard link number is 0 o'clock the file is actually deleted from the file system;

? Because the inode is unique within only one file system (partition), hard links cannot span the file system;

? Symbolic links do not have the above limitations, have greater flexibility, and can even link files across different machines and different networks.

Usage: ln [options] ... Target Link name (first format)

Or: ln [options] ... Target (second format)

Or: ln [options] ... Goal... Table of contents (third format)

In the first format, create the specified name and point to the specified target link.

In the second format, create a link to the target location in the current directory.

In the third format, create a link to the specified destination in the specified directory.

A hard link is created by default, and a symbolic link is created when you use-S. Each specified target must exist when a hard link is created. A symbolic link can point to any location (including a nonexistent location).

? -D Create a hard link to the directory (for Superuser only)

? -F, forcibly overwrite any existing target file

? -I confirm before overwriting the file

? -S creating Symbolic links

Linux System Management-topic 02: Managing Files (1) _2.4 link files _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.