全部博文(136)
分类: LINUX
2008-12-09 20:39:01
# 1. 使用文件 /oradata2/yct/rc.local 进行测试
[oracle@sbdatabase yct]$ pwd
/oradata2/yct [oracle@sbdatabase yct]$ ll total 4 -rwxr-xr-x 1 oracle dba 220 Dec 9 16:30 rc.local [oracle@sbdatabase yct]$ more rc.local #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local
# 2. 进行硬链接,inode 数增加
[oracle@sbdatabase yct]$ ln rc.local rc.local_hard.ln [oracle@sbdatabase yct]$ ll total 8 -rwxr-xr-x 2 oracle dba 220 Dec 9 16:30 rc.local -rwxr-xr-x 2 oracle dba 220 Dec 9 16:30 rc.local_hard.ln # 3. 进行符号链接,inode数并没有增加
[oracle@sbdatabase yct]$ ln -s rc.local rc.local_soft.ln [oracle@sbdatabase yct]$ ll total 8 -rwxr-xr-x 2 oracle dba 220 Dec 9 16:30 rc.local -rwxr-xr-x 2 oracle dba 220 Dec 9 16:30 rc.local_hard.ln lrwxrwxrwx 1 oracle dba 8 Dec 9 17:03 rc.local_soft.ln -> rc.local # 4. 删除原文件后,硬链接仍可用,而符号链接失效。
[oracle@sbdatabase yct]$ rm rc.local [oracle@sbdatabase yct]$ ll total 4 -rwxr-xr-x 1 oracle dba 220 Dec 9 16:30 rc.local_hard.ln lrwxrwxrwx 1 oracle dba 8 Dec 9 17:03 rc.local_soft.ln -> rc.local [oracle@sbdatabase yct]$ more rc.local_hard.ln #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local
[oracle@sbdatabase yct]$ more rc.local_soft.ln rc.local_soft.ln: No such file or directory # 5. 硬链接不能链接目录
[oracle@sbdatabase yct]$ rm -r * [oracle@sbdatabase yct]$ ll total 0 [oracle@sbdatabase yct]$ mkdir t1 [oracle@sbdatabase yct]$ ln t1 t1_hard.ln ln: `t1': hard link not allowed for directory [oracle@sbdatabase yct]$ ln -s t1 t1_soft.ln [oracle@sbdatabase yct]$ ll total 4 drwxr-xr-x 2 oracle dba 4096 Dec 9 17:09 t1 lrwxrwxrwx 1 oracle dba 2 Dec 9 17:09 t1_soft.ln -> t1 [oracle@sbdatabase yct]$ |
chinaunix网友2009-03-24 23:03:59
小伙,这篇文是原创么?看名字yct应该是吧 居然有个人的blog里也有这篇http://blog.chinaunix.net/u1/59481/showart_1763036.html