linux的软链接

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
<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/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值