SCIENTIFIC-LINUX-DEVEL Archives

October 2018

SCIENTIFIC-LINUX-DEVEL@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Marc W Mengel <[log in to unmask]>
Reply To:
Marc W Mengel <[log in to unmask]>
Date:
Mon, 8 Oct 2018 15:39:51 +0000
Content-Type:
multipart/alternative
Parts/Attachments:
text/plain (2359 bytes) , text/html (3142 bytes)




Interesting... I see similar strangeness:



<bel-kwinith:~/Desktop$> ls -li /usr/bin/which /bin/which

659285 -rwxr-xr-x. 1 root root 24336 May  2  2014 /usr/bin/which

659285 -rwxr-xr-x. 1 root root 24336 May  2  2014 /bin/which



Both are the same inode, so the link count *should* be 2.  The same is true of "bash":



<bel-kwinith:/tmp$> ls -li /bin/bash /usr/bin/bash

658498 -rwxr-xr-x. 1 root root 960608 Sep  5  2017 /bin/bash

658498 -rwxr-xr-x. 1 root root 960608 Sep  5  2017 /usr/bin/bash





But if I make links to a file, the link count is right:

<bel-kwinith:/tmp$> ls -li hello

2756645 -rw-rw-r--. 1 mengel mengel 1 Oct  8 10:35 hello

<bel-kwinith:/tmp$> ln hello goodbye

<bel-kwinith:/tmp$> ls -li hello goodbye

2756645 -rw-rw-r--. 2 mengel mengel 1 Oct  8 10:35 goodbye

2756645 -rw-rw-r--. 2 mengel mengel 1 Oct  8 10:35 hello

<bel-kwinith:/tmp$> ln hello aloha

<bel-kwinith:/tmp$> ls -li hello goodbye aloha

2756645 -rw-rw-r--. 3 mengel mengel 1 Oct  8 10:35 aloha

2756645 -rw-rw-r--. 3 mengel mengel 1 Oct  8 10:35 goodbye

2756645 -rw-rw-r--. 3 mengel mengel 1 Oct  8 10:35 hello



I'm almost tempted to remove one of them to see what happens to the other :-).



On 10/08/2018 10:12 AM, aleksander.baranowski wrote:



Hi,



Sorry for spamming mailing lists once more, but I'm probably missing

something.



So we have this package on called which-2.20-7.el7.x86_64.

The

`rpm -ql which | grep bin` returns:

/usr/bin/which



In the same time, there is `/bin/which` file that according to the

package is not provided with `which`.



then `rpm -qf /usr/bin/which /bin/which` returns

which-2.20-7.el7.x86_64

which-2.20-7.el7.x86_64



Tells us that the package provides this files.

Then

`stat /usr/bin/which /bin/which | grep -o 'Inode: [[:digit:]]*'`

return the same Inode for both files. But

ll /usr/bin/which /bin/which returns number of links that is equal 1. So

it's not hardlinked.



I'm baffled.



Any explanation is welcome.



Bests,

Alex













--

Marc W. Mengel

Software Services Senior Developer



Data Management and Applications

Fermi National Accelerator Laboratory

630 840 8256 office

www.fnal.gov<http://www.fnal.gov>



Connect with us!

Newsletter<http://www.fnal.gov/pub/today> | Facebook<%0Ahttps://www.facebook.com/Fermilab> | Twitter<https://twitter.com/FermilabToday>


ATOM RSS1 RSS2