经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » 数据库/运维 » Linux/Shell » 查看文章
Linux链接文件——操作链接文件
来源:cnblogs  作者:鲨猫  时间:2019/7/11 14:22:44  对本文有异议

Linux链接文件——操作链接文件

摘要:本文主要学习了在Linux系统中创建链接文件的命令。

ln命令

ln命令用于给文件创建链接,是Link的缩写。

基本语法

  1. 1 [root@localhost ~]# ln [选项] 源文件 目标文件

选项说明

  1. 1 -s:建立软链接文件。如果不加-s,则建立硬链接文件。如果源文件是在当前路径下,可以使用相对路径,否则如果不在当前路径下,则必须写成绝对路径。
  2. 2 -f:强制。如果目标文件已经存在,则删除目标文件后再建立链接文件。

使用举例

  1. 1 [root@localhost home]# ls
  2. 2 hello test
  3. 3 [root@localhost home]# ln hello hello-hard
  4. 4 [root@localhost home]# ls
  5. 5 hello hello-hard test
  6. 6 [root@localhost home]# ln test test-hard
  7. 7 ln: "test": 不允许将硬链接指向目录
  8. 8 [root@localhost home]# ln -s hello hello-soft
  9. 9 [root@localhost home]# ls
  10. 10 hello hello-hard hello-soft test
  11. 11 [root@localhost home]# ln -s test test-soft
  12. 12 [root@localhost home]# ls
  13. 13 hello hello-hard hello-soft test test-soft
  14. 14 [root@localhost home]#

原文链接:http://www.cnblogs.com/shamao/p/11169353.html

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号