Sample Header Ad - 728x90

Creating hard links

0 votes
2 answers
99 views
$ ln fun fun-hard $ ln fun dir1/fun-hard $ ln fun dir2/fun-hard $ ls -1 total 16 drwxrwxr-x 2 me 4096 2018-01-14 16:17 dir1 drwxrwxr-x 2 me 4096 2018-01-14 16:17 dir2 -rw-r—-r—- 4 me 1650 2018-01-10 16:33 fun -rw-r—-r—- 4 me 1650 2018-01-10 16:33 fun-hard So there are 4 instances of the file fun Both the second fields in the listings for fun and fun-hard contains a 4, which now is the number of hard links that now exist for the file. drwxrwxr-x 2 me 4096 2018-01-14 16:17 dir1 drwxrwxr-x 2 me 4096 2018-01-14 16:17 dir2 Why there’s 2 instances of the file fun-hard on dir1 and dir2? Isn’t there’s only one hard link: fun-hard? -rw-r—-r—- 4 me 1650 2018-01-10 16:33 fun -rw-r—-r—- 4 me 1650 2018-01-10 16:33 fun-hard Can you explain more these 4 instances of fun and fun-hard, why they are repeated? There are 2 hard links on dir1 and dir2, if…: -rw-r—-r—- 4 me 1650 2018-01-10 16:33 fun -rw-r—-r—- 4 me 1650 2018-01-10 16:33 fun-hard …there are 4 instances of hard links why dir1 and dir2 are not 4 instances also?
Asked by user599592 (27 rep)
Jan 23, 2024, 10:24 PM
Last activity: Jan 24, 2024, 11:53 AM