删除目录软链接注意事项
2016-02-15 15:48
344 查看
删除目录软链接注意事项 | 运维生存时间 http://www.ttlsa.com/linux/delete-directory-soft-link-notes/
软硬链接的区别在这里就不在阐述了。说一下删除目录软链接需要特别注意的地方:
系统环境:Linux Test.com 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
实验环境:在root 目录下创建一个测试目录 1 ,并在该目录下创建一个2.txt 的文件,写入内容 1.txt:
12345 | [root@server ~]# mkdir 1[root@server ~]# echo 1.txt > 1/2.txt[root@server ~]# tree 11└── 2.txt |
1 2 3 | [root@server ~]# ln -s /root/1 /tmp/ [root@server ~]# ls -l /tmp/1 lrwxrwxrwx 1 root root 7 Jan 26 15:53 /tmp/1 -> /root/1 |
123456789 | [root@server ~]# rm -rf /tmp/1[root@server ~]# ls /tmp/systemd-private-ba67187ff35444d0bf13da73ea656d0e-httpd.service-0ea0u7 3、查看源目录结构: [root@server ~]# tree 11└── 2.txt |
1 2 3 | [root@server ~]# ln -s /root/1 /tmp/ [root@server ~]# ls -l /tmp/1 lrwxrwxrwx 1 root root 7 Jan 26 15:56 /tmp/1 -> /root/1 |
123 | [root@server ~]# rm -rf /tmp/1/[root@server ~]# ls /tmp/1 systemd-private-ba67187ff35444d0bf13da73ea656d0e-httpd.service-0ea0u7 |
1 2 | [root@server ~]# tree 1 1 |
相关文章推荐
- OpenCV二次开发 编程规范
- HDU 4160 Dolls(DAG最小路径覆盖)
- 【CSS】从牛腩中深入思考盒子模型
- send函数 & recv函数
- JMeter测试是环境搭建&功能扩展
- 详解android:scaleType属性
- Handler及原理
- Linux中iostat命令参数详解
- 虚树练习集锦
- 自己动手做推送
- android 获得当前的时间
- FlashBack总结之闪回数据库与闪回删除
- Oracle XE手动建立数据库实例
- [Scala] 快学Scala A1L1
- Android Studio gradle 使用最新版本的 xstream:1.4.8 出错了
- 自定义控件View
- Linux CentOS6.5下编译安装MySQL 5.6.16【给力详细教程】
- 批量创建prefab
- jQuery 2.0.3 源码分析Sizzle引擎 - 高效查询
- Go conversion between struct and byte