Thursday, August 14, 2008

i-node

i-node store everything about files other than the content.
i-node stores the addresses where the content is stored.


Create a link to a file
First create a file with one or two sentences.
eg: example1.txt
Then create a link to that file using following command
ln example1.txt example2.txt
This is different from cp example1.txt and example2.txt, because in ln command both files share the same i-node.


Therefore when type ls –i we can see the i-node and number of links for the same i-node.
Then edit the content of one file (as an example : example1.txt). The content of other file is automatically changed. We can see that by typing cat example2.txt.


If change the permission of one file,
eg: chmod 751 example2.txt
Then permission of other file which linked to that one is automatically changed.

No comments: