1834481 Members
3261 Online
110067 Solutions
New Discussion

How to find hard links

 
Vidyasankar Narayanan
Occasional Contributor

How to find hard links

Hi All,
If I have a file and 10 hard links to the same file, how can I identify the original file?
The future belongs to those who believe in the beauty of their dreams.
2 REPLIES 2
Jdamian
Respected Contributor

Re: How to find hard links

Supose our file name is "hello.c"

find / -linkedto hello.c

Read manual pages of find command for more details.
Rodney Hills
Honored Contributor

Re: How to find hard links

A hard link is only another entry in another directory. The system does not distinguish an "original" file. They both share the same inode.

Maybe you are thinking of a symbolic link which does have an "original" file versus a seperate file pointer.
There be dragons...