Yeah, you're right. And I think I have to correct myself. You don't have
two inodes, you have two directoryentries pointing to the same inode. So
if you want to find corresponding files, you can sort by inodenumber:

find /usr/bin -type f -links '+1' -print0 | xargs -0 ls -li | sort -n

On Wed, Feb 03, 2010 at 10:02:37PM +0200, Alan McKinnon wrote:
> On Wednesday 03 February 2010 21:43:31 Stefan Schulte wrote:
> > Hi Jarry,
> > 
> > searching for softlinks is pretty easy:
> > 
> > find / -type l
> > 
> > If my understanding of hardlinks is correct you cannot say which file is
> > the original and which file is the link.
> 
> It's worse than that - the concept of "original" and "the link" simply does 
> not exist at all.
> 
> Like invisible pink unicorns; you can't say "you can't see them so you can't 
> say if it's there or not". The truth is "There are no invisible pink unicorns"
> 
> > Both inodes just point to the
> > same datablocks. But you can identify those files by checking the
> > linkcount.
> > 
> > find / -type f -links '+1'
> > 
> > -Stefan
> > 
> > On Wed, Feb 03, 2010 at 07:37:36PM +0100, Jarry wrote:
> > > Hi,
> > >
> > > just out of curiosity: is there any quick way to find all
> > > hard- and soft-links on a system? I just want to be sure
> > > they were all created after I moved system from the old disk
> > > to the new one...
> > >
> > > Jarry
> > 
> 
> -- 
> alan dot mckinnon at gmail dot com
> 

Attachment: pgptp35soYo6Z.pgp
Description: PGP signature

Reply via email to