Featured

    Featured Posts

HARD LINKS

A hard link is a duplicate directory entry. Both directory entries point to the same file (more precisely, the same inode). Neither entry holds any sort of priority over the other and both are equally valid. To delete the file, you must delete both hard links to the file.
To create a hard link, use the ln command without any options. You must specify the filename and the name of the link:
linux creating hard linux
In the example above we have created a hard link called hlink.lnk to the file original_file.txt. Note that both files have the same inode number.
Now we will change the content of the file and then read the new content using different filenames:
linux hard links change content
Because both directory entries point to the same file, we can use both filenames to access the content.
To delete a file, we must delete both directory entries:
linux deleting hard links
In the picture above you can see that, although we have deleted the original_file.txt, the file still exists.

NOTE – hard links can only be created to files on the same partition.
author

Author Name

Author Description!

Get Free Email Updates to your Inbox!

Post a Comment

www.ccna.ma

yu
Powered by Blogger.

Translate

Copyright © Learn Linux Th3pro.xyz | Blogger Templates | Designed By Code TAOUSSI