1、在test底下创建a、a的硬链接、a的软链接
[root@localhost test]# touch a
[root@localhost test]# ls
a
[root@localhost test]# ln /test/a a.hard
[root@localhost test]# ls
a a.hard
[root@localhost test]# ln -s /test/a a.soft
[root@localhost test]# ls
a a.hard a.soft
2、在a文件添加内容并查看软链接和硬链接内容
[root@localhost test]# echo 123 > a
[root@localhost test]# cat a a.hard a.soft
123
123
123
3、依次修改软硬链接内容,查看三个的内容
[root@localhost test]# echo 222 > a.hard
[root@localhost test]# cat a a.hard a.soft
222
222
222
[root@localhost test]# echo 333 > a.soft
[root@localhost test]# cat a a.hard a.soft
333
333
333
4、删除a文件,查看软链接和硬链接情况
[root@localhost test]# rm a
rm: remove regular file 'a'? y
[root@localhost test]# ls
a.hard a.soft
[root@localhost test]# cat a.hard a.soft
333
cat: a.soft: No such file or directory
硬链接正常,软链接出现报错
5、重新创建a文件并添加内容,查看a、硬链接、软连接情况
[root@localhost test]# echo 123 > a
[root@localhost test]# ls
a a.hard a.soft
[root@localhost test]# cat a a.hard a.soft
123
333
123
硬链接内容不变,软链接不再报错