1. What is the link count of a file?
The link count of a file tells the total number of links a file has which is nothing but the number of hard-links a file has. This count, however, does not include the soft-link count.
Note: The soft-link is not part of the link count since the soft-link's inode number is different from the original file.
2. How to find the link count of a file or directory?
The link count can be seen by using the ls -l command :
$ ls -l test.c
-rwxr-xr-x 1 guru users 267 Jul 18 16:59 test.c
By default, a file will have a link count of 1 i.e., any new file created will have a link count 1.