Linux link file type

Source: Internet
Author: User
Article Title: Linux link file type. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

There are two types of Linux linked files, which are similar to shortcuts in windows. However, the Linux link file type is different from that in windows.

One of the most important features of a Linux file system is its file link. The link is a reference to the file, so that you can see the file in the file system. However, in Linux, links can be treated as original files. Links can be executed, edited, and accessed like normal files. For other applications in the system, the link is the original file corresponding to it. When you edit a file through a link, you actually edit the original file. The link is not a copy. There are two types of links: hard link and symbolic link (soft link ).

Hard Link

Hard links can only reference files in the same file system. It references the physical indexes (also known as inode) of files in the file system ). When you move or delete the original file, the hard link will not be broken because it references the physical data of the file rather than the position of the file in the file structure. A hard-linked file does not require the user to have the permission to access the original file or display the location of the original file. This helps the file security. If the deleted file has a hard link, the file will still be retained until all references to it are deleted.

Symbolic Link (soft link)

A soft link is a pointer pointing to the position of a file in the file system. Symbolic Links can point to files in a remote file system across file systems. The symbolic link only specifies the location of the original file. You must have access to the location of the original file to use the link. If the original file is deleted, all symbolic links pointing to it will be damaged. They point to a location that does not exist in the file system.

Both links can be created using the ln command. By default, ln creates hard links. You can use the-s switch to create a symbolic link.

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.