Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2040660
  • 博文数量: 470
  • 博客积分: 10206
  • 博客等级: 上将
  • 技术积分: 5620
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-03 12:50
文章分类

全部博文(470)

文章存档

2012年(1)

2011年(18)

2010年(47)

2009年(404)

分类: LINUX

2009-04-03 20:12:01

[root@Greendays test]# ll
total 40
-rw-r--r-- 1 root root   62 Apr  3 19:53 0.txt
-rw-r--r-- 1 root root 1521 Apr  3 19:53 1.txt
-rw-r--r-- 1 root root  428 Apr  3 19:53 2.txt
-rw-r--r-- 1 root root  232 Apr  3 19:53 3.txt
-rw-r--r-- 1 root root   85 Apr  3 19:53 4.txt
[root@Greendays test]# ln 0.txt 00.txt
[root@Greendays test]# ll
total 44
-rw-r--r-- 2 root root   62 Apr  3 19:53 00.txt
-rw-r--r-- 2 root root   62 Apr  3 19:53 0.txt
-rw-r--r-- 1 root root 1521 Apr  3 19:53 1.txt
-rw-r--r-- 1 root root  428 Apr  3 19:53 2.txt
-rw-r--r-- 1 root root  232 Apr  3 19:53 3.txt
-rw-r--r-- 1 root root   85 Apr  3 19:53 4.txt
[root@Greendays test]# ln -s 0.txt 000.txt
[root@Greendays test]# ll
total 44
lrwxrwxrwx 1 root root    5 Apr  3 19:56 000.txt -> 0.txt
-rw-r--r-- 2 root root   62 Apr  3 19:53 00.txt
-rw-r--r-- 2 root root   62 Apr  3 19:53 0.txt
-rw-r--r-- 1 root root 1521 Apr  3 19:53 1.txt
-rw-r--r-- 1 root root  428 Apr  3 19:53 2.txt
-rw-r--r-- 1 root root  232 Apr  3 19:53 3.txt
-rw-r--r-- 1 root root   85 Apr  3 19:53 4.txt
执行ls -l 或者是 ll 命令之后在权限之后出现的数字1或者是2等,表示文件或者是目录的硬链接数目。
小弟看当你创建不同的链接时候这个数字的变化。创建硬链接的时候这个数字会变,创建符号链接的时候不会变,这个数字n 表示文件或者是目录的硬链接数目。
一个文件最少有一个硬链接。
一个目录(比如是/home/dir)则至少有2个硬链接,一个是目录本身(/home/dir)的入口,这个/home/dir目录的硬链接 ".."相当于该目录的父目录/home的".",另一个是目录内部的 ".",是在目录内表示本目录的入口。所以在目录内每多一个目录,就会多一个硬链接,因为子目录的".." 表示的父目录的入口相当于父目录的"."。




阅读(2702) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~