Introduction to inode and soft-hardware links from Linux

Source: Internet
Author: User

If half of the operating system is Microsoft, the other half should belong to the Linux operating system. As a result, many people began to learn about the new Linux operating system. This article describes inode, soft links, and hard links in Linux. The process of learning Linux has been improved.

Inode

Linux File System hard drive) is divided into two parts: inode table and data area. There are many inode on the inode table. Each inode records the attributes of an archive and the datablock on which the archive is distributed (that is, the pointer we call ). Inode has two functions: record file attributes and pointers. Data area consists of multiple datablocks, which record the actual content of the file.

Hard Link

Hard Link only adds the connected data of the file in a directory!

1. for example, my/home/vbird/crontab is a hard link file, which is linked to the/etc/crontab file, that is, in fact,/home/vbird/crontab and/etc/crontab are the same file, but there are two directories (/etc and/home/vbird) that record the related data of the crontab file! That is to say, I know that the inode of crontab is placed at A BY THE connected data recorded by the Block of/etc, and the joined data under the directory of/home/vbird, contab also refers to inode at! Therefore, the inode and block of the crontab file have not changed, and some have only two directories that record the associated data.

2. When hard link is used to set the link file, the disk space and inode quantity will not change! From the above description, we can know that hard link only writes one more connected data to the block in a directory, so inode and disk space will not be used.

3. When we modify the content of a file, the content of the file that is hard-linked to each other will also change. If we delete a file that is hard-linked to each other, other files will not be affected.

4. Since hard link establishes data connections on the same partition, there are restrictions on hard link:
A. Cross-Filesystem is not allowed.
B. You cannot link the directory.


5.false the hardware link of me.txt has been established: ln me.txt hard_me.txt .......
Then run ls-l:-rw-r -- 3 younes 40 2009-12-03 16:36 hard_me.txt. The numbers in the orange strip represent the number of hard links to the file.

Soft link

1. A Soft link is also called a symbolic link. It is different from a hard link. A Soft link file is only a mark of its source file. After the source file is deleted, the linked file cannot exist independently. Although the file name is retained, we cannot view the content of the soft link file.

2. the Symbolic Link and the Windows shortcut can be assigned an equal sign. The files created by the Symbolic link are an independent new file, which occupies inode and block calls.

This is the inode, soft link, and hard link of the Linux operating system.

  1. Describes how to install a wireless NIC Driver in Linux.
  2. Wine successfully runs Bitcomet in the Linux operating system
  3. Analysis of Open-source Cisco router virtual machines in Linux
  4. Basic Linux operating system knowledge
  5. Learning Manual: poll and select in 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.