转载:Linux: What’s the difference between a soft link and a hard link?
Link:https://www.moreofless.co.uk/linux-difference-soft-symbolic-link-and-hard-link/
This example shows the difference between a soft (also known as a symbolic link) and a hard link on a Linux system:
echo "hello" > a ---> create a file called "a"
ln a b ---> create hard link called "b" to "a"
ln -s a c ---> create soft link called "c" to "a"
No surprises here, printing the contents of files a, b and c produce the same result:
cat a ---> hello
cat b ---> hello
cat c ---> hello
Now we remove the original “a” file:
rm a
And the difference between the two links become obvious:
cat a ---> No such file or directory
cat b ---> hello
cat c ---> No such file or directory
The soft link is essentially a pointer to the original file and when the original file is deleted the soft link does not point to anything and so “no such file or directory” is reported. The hard link acts more like a mirror of the original file, it actually points to the same “node” in the filesystem that the original “a” file points to, so when we delete the original file “a” the file “c” still points to the same (and still existing) node in the filesystem.
转载:Linux: What’s the difference between a soft link and a hard link?的更多相关文章
- [转载]Linux进程调度原理
[转载]Linux进程调度原理 Linux进程调度原理 Linux进程调度的目标 1.高效性:高效意味着在相同的时间下要完成更多的任务.调度程序会被频繁的执行,所以调度程序要尽可能的高效: 2.加强交 ...
- [转载]Linux下非root用户如何安装软件
[转载]Linux下非root用户如何安装软件 来源:https://tlanyan.me/work-with-linux-without-root-permission/ 这是本人遇到的实际问题,之 ...
- [转载]Linux 命令详解:./configure、make、make install 命令
[转载]Linux 命令详解:./configure.make.make install 命令 来源:https://www.cnblogs.com/tinywan/p/7230039.html 这些 ...
- [转载]Linux缓存机制
[转载]Linux缓存机制 来源:https://blog.csdn.net/weixin_38278334/article/details/96478405 linux下的缓存机制及清理buffer ...
- 转载 linux内核 asmlinkage宏
转载http://blog.chinaunix.net/uid-7390305-id-2057287.html 看一下/usr/include/asm/linkage.h里面的定义:#define a ...
- [转载] Linux启动过程详解-《别怕Linux编程》之八
本原创文章属于<Linux大棚>博客,博客地址为http://roclinux.cn.文章作者为rocrocket.为了防止某些网站的恶性转载,特在每篇文章前加入此信息,还望读者体谅. = ...
- [转载]Linux命令笔记
*以下内容均来自于网络转载,感谢原作者分享 <对Linux新手非常有用的20个命令> 传送门 英文原文为“Switching From Windows to Nix or a Newbie ...
- [转载] Linux下高并发socket最大连接数所受的各种限制
原文: http://mp.weixin.qq.com/s?__biz=MzAwNjMxNjQzNA==&mid=207772333&idx=1&sn=cfc8aadb422f ...
- [转载]linux下svn常用指令
一下内容转载于:http://blog.chinaunix.net/space.php?uid=22976768&do=blog&id=1640924.这个总结的很好~ windows ...
随机推荐
- java web应用启动报错:Caused by: java.lang.ClassNotFoundException: ServletContext
ServletContext是个接口,不同的WEB容器(tomcat, jboss等)都有各自的实现. 一般是缺少servlet-api.jar包 在Java Build Path的Libraries ...
- 2020-07-22:你觉得使用redis的主从复制的时候有什么点需要注意的吗?
福哥答案2020-07-22: 1.主从同步缓冲区设定大小,如果进行全量复制耗时太长,进行部分复制时发现数据已经存在丢失的情况,必须进行第二次全量复制,致使slave陷入死循环状态.在全量复制的时候, ...
- CSS卡片右上角标记样式设计
template <div class="each-one-in-list"> <div class="show-icon">进行中&l ...
- Jmeter系列(49)- 详解 HTTP Cookie 管理器
如果你想从头学习Jmeter,可以看看这个系列的文章哦 https://www.cnblogs.com/poloyy/category/1746599.html 简单介绍 功能一 首先,它像网络浏览器 ...
- DataGrid样式
1.自定义列(DataGridTemplateColumn) <DataGridTemplateColumn Width="130"> <DataGridTemp ...
- JavaScript学习系列博客_4_JavaScript中的数据类型
JavaScript中有6种数据类型 一.基本数据类型 - String 字符串 JS中的字符串需要使用引号引起来双引号或单引号都行 但是要注意的是某种引号嵌套使用的话,需要加上 \ 转义.比如说我们 ...
- python基础 Day13
python Day13 匿名函数(一句话函数,比较简单的函数) func=lambda a,b:a+b print(func(1,2)) ###结果:3 func=lambda a:(a[0],a[ ...
- .Net Core中的诊断日志DiagnosticSource讲解
前言 近期由于需要进行分布式链路跟踪系统的技术选型,所以一直在研究链路跟踪相关的框架.作为能在.Net Core中使用的APM,SkyWalking自然成为了首选.SkyAPM-dotnet是 ...
- kolla搭建ironic裸机服务
参考链接: https://www.lijiawang.org/posts/kolla-ironic.html 准备ageng镜像: [root@control01 ~]# pip install d ...
- 1、Entity Framework Core 3.1入门教程-概述和准备工作
本文章是根据 微软MVP solenovex(杨旭)老师的视频教程编写而来,再加上自己的一些理解. 视频教程地址:https://www.bilibili.com/video/BV1xa4y1v7rR ...