linux的软链接
2016-01-18 15:55
405 查看
linux下的软链接类似于windows下的快捷方式。
ln -s a b 中的 a 就是源文件,b是链接文件名(快捷方式),其作用是当进入b目录,实际上是链接进入了a目录
执行命令的时候,应该是a目录已经建立,目录b(快捷方式)没有建立。
<span style="white-space:pre"> </span>a /mnt/test 此目录必须已经建立
<span style="white-space:pre"> </span>b /data/test 此目录<span style="font-family: helvetica, tahoma, arial, sans-serif;">必须</span><span style="font-family: helvetica, tahoma, arial, sans-serif;">没有建立,也就是说/data没有test这个目录。</span>
<span style="white-space:pre"> </span>ln -sf /mnt/test /data/test
这样进入/data/test,实际上是进入/mnt/test
如何删除软链接:
rm -rf b 注意不是rm
-rf b/
ln -s a b 中的 a 就是源文件,b是链接文件名(快捷方式),其作用是当进入b目录,实际上是链接进入了a目录
执行命令的时候,应该是a目录已经建立,目录b(快捷方式)没有建立。
<span style="white-space:pre"> </span>a /mnt/test 此目录必须已经建立
<span style="white-space:pre"> </span>b /data/test 此目录<span style="font-family: helvetica, tahoma, arial, sans-serif;">必须</span><span style="font-family: helvetica, tahoma, arial, sans-serif;">没有建立,也就是说/data没有test这个目录。</span>
<span style="white-space:pre"> </span>ln -sf /mnt/test /data/test
这样进入/data/test,实际上是进入/mnt/test
<p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; clear: both; height: auto; overflow: hidden; color: rgb(85, 85, 85); font-size: 14px; font-family: helvetica, tahoma, arial, sans-serif; line-height: 25px;">效果如下:<span style="font-size:14px;"> </span></p><p style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; clear: both; height: auto; overflow: hidden; color: rgb(85, 85, 85); font-family: menlo;"><span style="font-size:14px;">lrwxr-xr-x 1 root wheel 9 Dec 2 17:57 /data/test -> /mnt/test</span></p>
如何删除软链接:
rm -rf b 注意不是rm
-rf b/
相关文章推荐
- linux 修改终端颜色
- linux命令安装
- 【linux】命令
- linux安装mysql
- Linux环境下提升普通用户权限(sudo)
- linux 怎么样复制文件夹内所有文件到另一个文件夹?
- Linux meld安装
- Linux学习netstat
- linux常用基本命令
- linux 增加sudo权限
- linux-0.12/boot/bootsect.S下的常见问题
- linux下后台启动weblogic服务(还有些注意事项)
- Centos 安装Rsync笔记
- centos 服务器装与python34源码安装
- CentOS/RHEL6.5中使用WordPress快速建站
- 基于阿里云centos 6.5 mysql安装配置,以及mysql备份配置
- How to kill a process on a port on linux 怎么杀死 关掉一个端口
- linux下如何自动生成Makefile文件
- Common administrative commands in Red Hat Enterprise Linux 5, 6, and 7
- linux下为php添加curl扩展的方法