Documente Academic
Documente Profesional
Documente Cultură
Hardlinks
Make a hardlink to FileA. Call the hardlink FileB.
$ ln FileA FileB
Use the "i" argument to list the inodes for both FileA and its hardlink.
$ ls -il FileA FileB
This is what you get:
1482256 -rw-r--r-- 2 bruno bruno
1482256 -rw-r--r-- 2 bruno bruno
21 May 5 15:55 FileA
21 May 5 15:55 FileB
Both FileA and FileB have the same inode number (1482256).
Also both files have the same file permissions and the same size.
Because that size is reported for the same inode, it does not consume any extra
space on HD!
Next, remove the original FileA:
$ rm FileA
And have a look at the content of the "link" FileB:
MAIT/Alok/Namita
128
$ cat FileB
You will still be able to read the contents of file.