Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question 开发者_C百科What is the size of the hardlink
in Linux
? Will it be the size of the inode
? If I have two of them?
Thanks in advnace for any explanation, I tried to google
it, but didn't find anything
A hard link reuses the inode, but requires a separate directory entry, which takes up 8 bytes plus the length of the file name in ext2. There may be other costs associated, such as when directory indexing is used, also, directories grow by entire blocks.
Think of a hard link as just another name for a file. If a file has 1000 hard links, that just means that it has 1000 different directory entries associated with it, all with potentially different names. For example, if you had 1000 different names, you would still only be one person. You'd take up the same amount of space no matter how many names you had. You'd just have a bit more paperwork for each additional name.
精彩评论