Linux Common Commands--ln

Source: Internet
Author: User
Tags joins

ln 显示文件的类型

Syntax format: ln "option" "Source" "Target" file [option] [meta file or directory] [destination file or directory]
Attention:

    1. The file command and subsequent options and files must have at least one space between each element
      Option Description:
parameter Options Explanatory notes
No parameters Create a hard link
-S Creating a soft connection

Case one:
Hard Links

Hard Link Summary:

    1. Multiple files with the same Inode node number are hard-linked files to each other
    2. Delete Hard link my file or delete the original file any one, the file entity is not deleted
    3. The file entity is deleted only if the original file and all the corresponding hard link files of the original file are deleted.
    4. However, after all the hard link files and the source files are deleted, the file space will be occupied when the new data is stored, or when the disk fsck is checked, the deleted data will be collected by the system.
    5. A hard-link file is another entrance to the file
    6. You can prevent important files from accidentally deleting files by setting hard-link files to them.
    7. Execute the command "ln source file Hard link file" to complete the hard link creation
    8. Hard-link files can be deleted with the RM command
    9. For a static file (no process is picking the file), when the corresponding hard connection number is 0 o'clock, the file will be deleted, I_link view method is Ls-lih, view the result of the third column, that is, the number of hard links.
      Case TWO:
      Soft connection

      Soft Connection Summary:
    10. Soft joins are similar to shortcuts in Windows
    11. A soft connection is similar to a text file in which the source file is stored, pointing to the source file entity
    12. The soft-connect file still exists, even though the source file is deleted, but the source file path content that points to is inaccessible
    13. When it fails, it's usually a red font flashing.
    14. Implement the command "ln-s source file Soft Connection file" to complete the creation of a soft connection
    15. Soft joins and source files are different types of files and are different files, and inode numbers are not the same.
    16. To delete a soft connection file, you can use the RM command

Linux Common Commands--ln

Related Article

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.