[url]http://www.cnblogs.com/xiaochaohuashengmi/archive/2011/10/05/2199534.html[/url]
[code="java"]
建立软连接
# ls -il
总计 0
1491138 -rw-r–r– 1 root root 48 07-14 14:17 file1
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2hand
# ln -s file1 file1soft
# ls -il
总计 0
1491138 -rw-r–r– 1 root root 48 07-14 14:17 file1
1491140 lrwxrwxrwx 1 root root 5 07-14 14:24 file1soft -> file1
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2hand
删除软连接
rm -rf symbolic_name 注意不是rm -rf symbolic_name/
# ls -il
总计 0
1491138 -rw-r–r– 1 root root 0 07-14 14:17 file1
1491140 lrwxrwxrwx 1 root root 5 07-14 14:24 file1soft -> file1
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2hand
# rm -rf file1soft
# ls -il
总计 0
1491138 -rw-r–r– 1 root root 0 07-14 14:17 file1
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2hand
#
[/code]
[code="java"]
建立软连接
# ls -il
总计 0
1491138 -rw-r–r– 1 root root 48 07-14 14:17 file1
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2hand
# ln -s file1 file1soft
# ls -il
总计 0
1491138 -rw-r–r– 1 root root 48 07-14 14:17 file1
1491140 lrwxrwxrwx 1 root root 5 07-14 14:24 file1soft -> file1
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2hand
删除软连接
rm -rf symbolic_name 注意不是rm -rf symbolic_name/
# ls -il
总计 0
1491138 -rw-r–r– 1 root root 0 07-14 14:17 file1
1491140 lrwxrwxrwx 1 root root 5 07-14 14:24 file1soft -> file1
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2hand
# rm -rf file1soft
# ls -il
总计 0
1491138 -rw-r–r– 1 root root 0 07-14 14:17 file1
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2
1491139 -rw-r–r– 2 root root 0 07-14 14:17 file2hand
#
[/code]