Hardware and software connection for Linux 🔗

Naming conventions

Hard Link

Symbolic Link

Linux File Features

Files of any type on all disks are assigned a number (index node)

Hard connection characteristics

1. Multiple files point to the same index node

2. A file has multiple valid pathnames

3, delete: the actual deletion of the file is the condition that all the hard connected files related to it are deleted.

Soft connection characteristics

1. Windows-like shortcuts

2, text file: store the location information of the target file

The test case

create

File association test

conclusion

1). Deleting symbolic link F3 has no effect on F1 and F2;

2). Delete hard connection F2, and f1 and F3 are not affected;

3). Delete the original file F1, which has no effect on hard connection F2, resulting in the failure of symbol connection F3;

4). At the same time delete the original file f1, hard link f2, the entire file will be deleted.