首页 > 系统服务 > 详细

Linux-软连接与硬链接

时间:2020-10-17 22:37:39      阅读:44      评论:0      收藏:0      [点我收藏+]

软连接与硬链接

软连接类似于Windows下的快捷方式

硬链接相当于备份,建立多个路径,防止误删

  • touch:创建文件

  • echo:写入内容到文件中,其中>写入覆盖文件所有内容,>>在文件尾部追加

[root@dragon home]# ls
admin  test1  www
[root@dragon home]# ln test1 test2
[root@dragon home]# ls
admin  test1  test2  www
[root@dragon home]# echo "IMA" >> test1
[root@dragon home]# cat test1
IMA
[root@dragon home]# cat test2
IMA
[root@dragon home]# ln -s test3
[root@dragon home]# ls
admin  test1  test2  test3  www
[root@dragon home]# ln -s test1 test3
[root@dragon home]# ls
admin  test1  test2  test3  www
[root@dragon home]# ll
total 16
drwx------ 3 admin admin 4096 Dec 31  2019 admin
-rw-r--r-- 2 root  root     4 Oct 13 22:00 test1
-rw-r--r-- 2 root  root     4 Oct 13 22:00 test2
lrwxrwxrwx 1 root  root     5 Oct 13 22:01 test3 -> test1
drwx------ 2 www   www   4096 Oct 13 19:43 www
[root@dragon home]# cat test3
IMA

Linux-软连接与硬链接

原文:https://www.cnblogs.com/LFTW/p/13832382.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!