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?的更多相关文章

  1. [转载]Linux进程调度原理

    [转载]Linux进程调度原理 Linux进程调度原理 Linux进程调度的目标 1.高效性:高效意味着在相同的时间下要完成更多的任务.调度程序会被频繁的执行,所以调度程序要尽可能的高效: 2.加强交 ...

  2. [转载]Linux下非root用户如何安装软件

    [转载]Linux下非root用户如何安装软件 来源:https://tlanyan.me/work-with-linux-without-root-permission/ 这是本人遇到的实际问题,之 ...

  3. [转载]Linux 命令详解:./configure、make、make install 命令

    [转载]Linux 命令详解:./configure.make.make install 命令 来源:https://www.cnblogs.com/tinywan/p/7230039.html 这些 ...

  4. [转载]Linux缓存机制

    [转载]Linux缓存机制 来源:https://blog.csdn.net/weixin_38278334/article/details/96478405 linux下的缓存机制及清理buffer ...

  5. 转载 linux内核 asmlinkage宏

    转载http://blog.chinaunix.net/uid-7390305-id-2057287.html 看一下/usr/include/asm/linkage.h里面的定义:#define a ...

  6. [转载] Linux启动过程详解-《别怕Linux编程》之八

    本原创文章属于<Linux大棚>博客,博客地址为http://roclinux.cn.文章作者为rocrocket.为了防止某些网站的恶性转载,特在每篇文章前加入此信息,还望读者体谅. = ...

  7. [转载]Linux命令笔记

    *以下内容均来自于网络转载,感谢原作者分享 <对Linux新手非常有用的20个命令> 传送门 英文原文为“Switching From Windows to Nix or a Newbie ...

  8. [转载] Linux下高并发socket最大连接数所受的各种限制

    原文: http://mp.weixin.qq.com/s?__biz=MzAwNjMxNjQzNA==&mid=207772333&idx=1&sn=cfc8aadb422f ...

  9. [转载]linux下svn常用指令

    一下内容转载于:http://blog.chinaunix.net/space.php?uid=22976768&do=blog&id=1640924.这个总结的很好~ windows ...

随机推荐

  1. 狄利克雷卷积 & 莫比乌斯反演

    积性函数与完全积性函数 积性函数 若一个数论函数\(f\)满足当\(gcd(n,m)=1\)时,\(f(nm)=f(n)f(m)\) 则称\(f\)为积性函数 一些常见的积性函数 完全积性函数 若一个 ...

  2. 强开企业付款到零钱与现金红包,无需等待90/30天,2-12H即可强开通!

    一.微信官方给出的,企业付款到零钱|现金红包开通的说明 针对入账方式为即时入账至商户号,结算周期为T+1的商户,需满足三个条件:1)入驻满90天,2)连续正常交易30天,3)保持正常健康交易.其余结算 ...

  3. Vue + ccropper.js裁切图片(vue-cropper)

    按原比例裁剪图片并且不失真. 安装: cnpm install vue-cropper --save-dev 使用: <template> <div style="disp ...

  4. LeetCode 413 Arithmetic Slices详解

    这个开始自己做的动态规划复杂度达到了O(n), 是用的是2维的矩阵来存前面的数据,复杂度太高了, 虽然好理解,但是没效率,后面看这个博客发现没有动态规划做了这个题 也是比较厉害. 转载地址: http ...

  5. Java中对象和对象引用的区别,引用、指向是什么意思

    Java的变量分为两大类:基本数据类型和引用数据类型. 其中基本类型变量有四类8种:byte short int long float double char boolean,除了8种基本数据类型变量 ...

  6. 精讲响应式webclient第1篇-响应式非阻塞IO与基础用法

    笔者在之前已经写了一系列的关于RestTemplate的文章,如下: 精讲RestTemplate第1篇-在Spring或非Spring环境下如何使用 精讲RestTemplate第2篇-多种底层HT ...

  7. MySQL数据库根据一个或多个字段查询重复数据

    系统在开发测试过程中出现bug,比如并发操作没有处理好,数据库中往往会插入重复数据,这些脏数据经常会导致各种问题.bug可以修改,但是数据往往也要处理,处理SQL如下: 1.根据一个字段查找重复数据 ...

  8. Inherent Adversarial Robustness of Deep Spiking Neural Networks: Effects of Discrete Input Encoding and Non-Linear Activations

    郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布! arXiv:2003.10399v2 [cs.CV] 23 Jul 2020 ECCV 2020 1 https://github.com ...

  9. Spark SQL dropDuplicates

    spark sql 数据去重 在对spark sql 中的dataframe数据表去除重复数据的时候可以使用dropDuplicates()方法 dropDuplicates()有4个重载方法 第一个 ...

  10. 网站会不会因为同IP网站被K而受到惩罚

    http://www.wocaoseo.com/thread-289-1-1.html 使用虚拟主机的网站会不会因为同一个IP或同一台服务器上有其他网站作弊被处罚而受连累,也被惩罚? 复制代码 百度官 ...