coreutils
[Top][All Lists]
Advanced

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

Re: [coreutils] How to figure out all the hard links that link to the sa


From: wayana
Subject: Re: [coreutils] How to figure out all the hard links that link to the same file?
Date: Tue, 27 Jul 2010 09:30:36 +0200

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 <address@hidden> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]