[C:\~]$ ssh 192.168.137.129
Connecting to 192.168.137.129:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Activate the web console with: systemctl enable --now cockpit.socket
Register this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
/usr/bin/xauth: file /root/.Xauthority does not exist
[root@localhost ~]# mkdir test
[root@localhost ~]# ls
anaconda-ks.cfg test
[root@localhost ~]# cd /~
-bash: cd: /~: No such file or directory
[root@localhost ~]# cd /
[root@localhost /]# ls
afs bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
[root@localhost /]# mkdir test
[root@localhost /]# ls
afs bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys test tmp usr var
[root@localhost /]# cd /test/
[root@localhost test]# touch a
[root@localhost test]# la
bash: la: command not found...
[root@localhost test]# ls
a
[root@localhost test]# ln a
ln: failed to create hard link './a': File exists
[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
[root@localhost test]# ll
total 0
-rw-r--r--. 2 root root 0 Mar 9 08:18 a
-rw-r--r--. 2 root root 0 Mar 9 08:18 a.hard
lrwxrwxrwx. 1 root root 7 Mar 9 08:21 a.soft -> /test/a
[root@localhost test]# echo 123 > a
[root@localhost test]# cat a a.hard a.soft
123
123
123
[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
[root@localhost test]# rm a
rm: remove regular file 'a'? y
[root@localhost test]# ls
a.hard a.soft
[root@localhost test]# ll
total 4
-rw-r--r--. 1 root root 4 Mar 9 08:24 a.hard
lrwxrwxrwx. 1 root root 7 Mar 9 08:21 a.soft -> /test/a
[root@localhost test]# cat a a.hard a.soft
cat: a: No such file or directory
333
cat: a.soft: No such file or directory
[root@localhost test]# echo 123 > a
[root@localhost test]# ls
a a.hard a.soft
[root@localhost test]# ll
total 8
-rw-r--r--. 1 root root 4 Mar 9 08:26 a
-rw-r--r--. 1 root root 4 Mar 9 08:24 a.hard
lrwxrwxrwx. 1 root root 7 Mar 9 08:21 a.soft -> /test/a
[root@localhost test]# cat a a.hard a.soft
123
333
123
[root@localhost test]# stat a a.hard a.soft
File: a
Size: 4 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 34989256 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Context: unconfined_u:object_r:default_t:s0
Access: 2023-03-09 08:26:39.811342324 -0500
Modify: 2023-03-09 08:26:27.195407173 -0500
Change: 2023-03-09 08:26:27.195407173 -0500
Birth: 2023-03-09 08:26:27.195407173 -0500
File: a.hard
Size: 4 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 34989254 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Context: unconfined_u:object_r:default_t:s0
Access: 2023-03-09 08:25:54.514605784 -0500
Modify: 2023-03-09 08:24:59.403959632 -0500
Change: 2023-03-09 08:25:37.889712230 -0500
Birth: 2023-03-09 08:18:11.548982180 -0500
File: a.soft -> /test/a
Size: 7 Blocks: 0 IO Block: 4096 symbolic link
Device: fd00h/64768d Inode: 34989255 Links: 1
Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Context: unconfined_u:object_r:default_t:s0
Access: 2023-03-09 08:21:38.077064993 -0500
Modify: 2023-03-09 08:21:35.903081697 -0500
Change: 2023-03-09 08:21:35.903081697 -0500
Birth: 2023-03-09 08:21:35.903081697 -0500
[root@localhost test]#
以上操作包括软硬链接以及文件之间的区别