Hello, How about using 'find' ?
$ find -inum $(ls -i a | cut -d ' ' -f 1) ./b ./a On Tue, Jul 27, 2010 at 5:35 AM, Peng Yu <[email protected]> wrote: > Hi, > > If I inspect the results from 'stat', I know that the file 'a' and 'b' > are the same. But if I only know 'a', is there a way to figure out > that what other hard links are linked to 'a'? > > $ touch a > $ ln a b > $ stat a > File: `a' > Size: 0 Blocks: 0 IO Block: 1048576 regular empty > file > Device: 1bh/27d Inode: 536962518 Links: 2 > Access: (0644/-rw-r--r--) Uid: ( 1100/ pengy) Gid: ( 1100/ pengy) > Access: 2010-07-26 22:31:01.884438080 -0500 > Modify: 2010-07-26 22:31:01.884438080 -0500 > Change: 2010-07-26 22:31:03.632371498 -0500 > $ stat b > File: `b' > Size: 0 Blocks: 0 IO Block: 1048576 regular empty > file > Device: 1bh/27d Inode: 536962518 Links: 2 > Access: (0644/-rw-r--r--) Uid: ( 1100/ pengy) Gid: ( 1100/ pengy) > Access: 2010-07-26 22:31:01.884438080 -0500 > Modify: 2010-07-26 22:31:01.884438080 -0500 > Change: 2010-07-26 22:31:03.632371498 -0500 > > > -- > Regards, > Peng >
