inode query..

Mulley, Nikhil mnikhil at corp.untd.com
Tue Mar 8 06:03:48 UTC 2005


Hi All,
I have a doubt here .. I have created a file and noted its inode number and then edited the file with vi, I am amused that inode entry got changed.
 
[root at linuxbox123 tennis]# touch test
[root at linuxbox123 tennis]# ls -il
total 0
131381 -rw-r--r--  1 root root 0 Mar  8 10:36 test
[root at linuxbox123 tennis]# vi test
[root at linuxbox123 tennis]# ls -il
total 4
131386 -rw-r--r--  1 root root 8 Mar  8 10:37 test
[root at linuxbox123 tennis]# cat test
test123
 
-------------------------------
[root at linuxbox123 tennis]# cat > test
Test123
 
[1]+  Stopped                 cat >test
[root at linuxbox123 tennis]# cat test
Test123
[root at linuxbox123 tennis]# ls -il
total 4
131386 -rw-r--r--  1 root root 8 Mar  8 11:25 test
[root at linuxbox123 tennis]#
--------------------------------
[root at linuxbox123 tennis]# vi test
[root at linuxbox123 tennis]# cat test
Test123
test123
[root at linuxbox123 tennis]# ls -il
total 4
131385 -rw-r--r--  1 root root 16 Mar  8 11:26 test
[root at linuxbox123 tennis]#
-----------------------------------
 
Now, I do not understand why this inode entries get changed with Vi but not cat , can any one please tell me why is it so..
 
thanks,
Nikhil
 



More information about the redhat-list mailing list