本节内容:
如何删除linux目录软链接文件?
操作示例:
 
复制代码 代码示例:
[root@jbxue kernels]# ln -s /home/huage huage
[root@jbxue kernels]# ln -s /boot/vmlinuz-2.6.32-71.el6.i686 vmlinuz
[root@jbxue kernels]# ls -l
total 8
drwxr-xr-x. 22 root root 4096 Dec 31 03:48 2.6.32-71.el6.i686
lrwxrwxrwx   1 root root   11 Apr 24 15:29 huage -> /home/huage
drwxrwxr-x  24 root root 4096 Apr 24 15:14 linux-2.6.38.4
lrwxrwxrwx   1 root root   32 Apr 24 15:29 vmlinuz -> /boot/vmlinuz-2.6.32-71.el6.i686
[root@jbxue kernels]# rm -rf vmlinuz 
[root@jbxue kernels]# rm -rf huage/
[root@jbxue kernels]# ls
2.6.32-71.el6.i686  huage  linux-2.6.38.4
注意,对于软链接目录,删除时不能加/,否则无法删除。
例如:
 
复制代码 代码示例:
[root@jbxue kernels]# rm -rf huage
[root@jbxue kernels]# ls
2.6.32-71.el6.i686  linux-2.6.38.4
 
软链接目录huage被删除了。