[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to find all hard links of the same file



On Sun, Sep 14, 2008 at 03:32:20PM -0300, Eduardo M KALINOWSKI wrote:
> T o n g wrote:
> > Hi, 
> >
> > If the hard link field of a file is more than one, how can I find out all 
> > the other hard links to this file?
> >   
> 
> find <root of the filesystem where the file is> -xdev -samefile <path to
> file>

Yes.  This is ia very good answer.

If you have file "foo" on a filesystem mounted on /path/to/mount/point/
$ ls -i foo
2555927 foo
$ find /path/to/mount/point -xdev -inum 2555927

This is more stepwise and explains what it does.

Osamu


Reply to: