免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 942 | 回复: 0
打印 上一主题 下一主题

第一章 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-06-05 13:16 |只看该作者 |倒序浏览


In the following example, inode 1282 now has two hard links, one for
file1 and the other for file2. The ls -li command lists the inode
number in the left-most column. The find -inum command locates files
and directories that have the same inode numbers.
# ln file1 file2
# ls -l
total 0
-rw-r--r-- 2 root other 0 Apr 7 15:26 file1
-rw-r--r-- 2 root other 0 Apr 7 15:26 file2
# ls -li
total 0
1282 -rw-r--r-- 2 root other 0 Apr 7 15:26 file1
1282 -rw-r--r-- 2 root other 0 Apr 7 15:26 file2
# find . -inum 1282
./file1
./file2



# ls -lL
The symbolic links in the /dev/dsk directory point to block-special device
files.


# ls -lL
The /dev/pts directory contains symbolic links.
The symbolic links in the /dev/pts directory point to character-special
device files.



# ln -s file1 link1
10. List file1 and the link1 symbolic link. Do these files use the same
or different inodes?
# ls -li
These two files use two different inodes.
bash-3.00# touch file1
bash-3.00# ls -l file1
-rw-r--r--   1 root     root           0  6月  5日 13:12 file1
bash-3.00# ln -s file1 file2
bash-3.00# ls -li file*
     91276 -rw-r--r--   1 root     root           0  6月  5日 13:12 file1
     91287 lrwxrwxrwx   1 root     root           5  6月  5日 13:12 file2 -> file1




bash-3.00# mkdir newdir
bash-3.00# ls -ldi newdir
    378560 drwxr-xr-x   2 root     root         512  6月  5日 13:14 newdir
bash-3.00# ls -lia newdir
总数 4
    378560 drwxr-xr-x   2 root     root         512  6月  5日 13:14 .
         2 drwxr-xr-x  38 root     root        1024  6月  5日 13:14 ..
bash-3.00# mkdir newdir/dir2
bash-3.00# ls -ldi newdir
    378560 drwxr-xr-x   3 root     root         512  6月  5日 13:17 newdir
bash-3.00# ls -laRi newdir
newdir:
总数 6
    378560 drwxr-xr-x   3 root     root         512  6月  5日 13:17 .
         2 drwxr-xr-x  38 root     root        1024  6月  5日 13:14 ..
    378561 drwxr-xr-x   2 root     root         512  6月  5日 13:17 dir2
newdir/dir2:
总数 4
    378561 drwxr-xr-x   2 root     root         512  6月  5日 13:17 .
    378560 drwxr-xr-x   3 root     root         512  6月  5日 13:17 ..





本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/40476/showart_314915.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP