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/

来说是非者,便是是非人。

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

相关文章:

你感兴趣的文章:

标签云: