root@v:/usr/local# mkdir inodelink root@v:/usr/local# cd inodelink root@v:/usr/local/inodelink# ls root@v:/usr/local/inodelink# touch file1
root@v:/usr/local/inodelink# ls file1 root@v:/usr/local/inodelink# ln file1 file2 root@v:/usr/local/inodelink# ln -s file1 file3
root@v:/usr/local/inodelink# ls -li total 0 560454 -rw-r--r-- 2 root root 0 Apr 18 21:29 file1 560454 -rw-r--r-- 2 root root 0 Apr 18 21:29 file2 560455 lrwxrwxrwx 1 root root 2 Apr 18 21:30 file3 -> file1
root@v:/usr/local/inodelink# echo "I am file1" >> file1 root@v:/usr/local/inodelink# cat file1 I am file1
root@v:/usr/local/inodelink# cat file2 I am file1 root@v:/usr/local/inodelink# cat file3 I am file1 root@v:/usr/local/inodelink# rm file1 root@v:/usr/local/inodelink# ls file2 file3 删除file1,看file2和file3的情况 root@v:/usr/local/inodelink# ls -li total 4 560454 -rw-r--r-- 1 root root 13 Apr 18 21:31 file2 560455 lrwxrwxrwx 1 root root 2 Apr 18 21:30 file3 -> file1 file2和file3都“存在” root@v:/usr/local/inodelink# cat file2 I am file1 root@v:/usr/local/inodelink# cat file3 cat: file3: No such file or directory
原文:http://blog.csdn.net/huqinwei987/article/details/24051425