linux环境下创建和删除软链接

linux环境下创建和删除软链接

ln -s /home/zhenwx/htccode-v1/    /home/zhenwx/htccode       建立/home/zhenwx/htccode-v1 的软连接



linux下的软链接类似于windows下的快捷方式



ln -s /home/zhenwx/htccode-v1/    /home/zhenwx/htccode     中的/home/zhenwx/htccode-v1/就是源文件,/home/zhenwx/htccode      是链接文件名,其作用是当进入/home/zhenwx/htccode     目录,实际上是链接进入了/home/zhenwx/htccode-v1/目录

如上面的示例,当我们执行命令   cd /home/zhenwx/htccode/的时候  实际上是进入了 /home/zhenwx/htccode-v1/



值得注意的是执行命令的时候,应该是/home/zhenwx/htccode-v1/ 目录已经建立,不要创建目录/home/zhenwx/htccode/。

删除软链接:

   rm -rf  /home/zhenwx/htccode 注意不是rm -rf  /home/zhenwx/htccode/

猜你喜欢

转载自usench.iteye.com/blog/2185673
今日推荐