Table of Contents
TODO Hardlinks and softlinks
Hard link
Hard link:
echo "111" > test.txt
ln test.txt hlinkToTest
rm -rf test.txt
cat hlinkToTest
Hardlink links to the content of the file. You can access content until the very last of the hard links exist.
Hard link OriginalFilename (test.txt)
\ /
_\| |/_
Inode
878945
|
|
\|/
Data on Hard Drive
Soft link
echo "111" > test.txt
ln test.txt slinkToTest
rm -rf test.txt
cat slinkToTest
Does to work because slinkToTest linked to test.txt name, not to the file content itself.
Softlink links to other filename, not to content itself. Soft link can’t access the content of riginalFilename if OriginalFilename is deleted.
Soft link --> OriginalFilename (test.txt)
| |
| |
\|/ \|/
Inode Inode
948540 948545
|
|
\|/
Data on Hard Drive
The picture above is corrected version of as it is described in the comments below the post https://stackoverflow.com/a/47786856/13215783.
Hyperlinks
https://en.wikipedia.org/wiki/Symbolic_link
https://en.wikipedia.org/wiki/Hard_link