public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Ulli Horlacher <framstag@rus.uni-stuttgart.de>
To: cygwin@cygwin.com
Subject: hardlinks on directories?
Date: Thu, 30 Jan 2020 18:16:00 -0000	[thread overview]
Message-ID: <20200130181516.GA29782@tik.uni-stuttgart.de> (raw)

(I am a UNIX senior admin, but have VERY few knowledge on Windows)

UNIX does not support hard links on directories (in opposite to Windows?). 

I found:

/: uname -a
CYGWIN_NT-10.0 W10dev 3.1.2(0.340/5/3) 2019-12-21 15:25 x86_64 Cygwin

/: ls -ldi /bin /usr/bin
281474976929589 drwxr-xr-x+ 1 admin None 0 Jan 29 16:01 /bin
281474976929589 drwxr-xr-x+ 1 admin None 0 Jan 29 16:01 /usr/bin

/: ls -ldi /lib /usr/lib
281474976929595 drwxr-xr-x+ 1 admin None 0 Jun 15  2018 /lib
281474976929595 drwxr-xr-x+ 1 admin None 0 Jun 15  2018 /usr/lib


Are this directory hard links?
Their content seems to be identical.

(How) can I find out with Cygwin which directories are hard links?
I could run "find / -xdev -type d -printf "%i %p\n" and look for same
inodes. 
Is there a better methode?

/: find / -xdev -type d -printf "%i %p\n" | perl -wne 'push @{$i{$1}},$2 if /^(\d+) (.+)/; END { foreach $n (keys %i) { @f = @{$i{$n}}; print "$n: @f\n" if scalar(@f) > 1} }' | sort -n | head
2: /proc /cygdrive
281474976929589: /bin /usr/bin
281474976929595: /lib /usr/lib
281474976935384: /lib/pkcs11 /usr/lib/pkcs11
281474976935494: /lib/gawk /usr/lib/gawk
281474976938256: /lib/groff /usr/lib/groff
281474976939240: /lib/security /usr/lib/security
281474976939616: /lib/engines-1.1 /usr/lib/engines-1.1
281474976939876: /lib/sasl2_3 /usr/lib/sasl2_3
281474976940081: /lib/p7zip /usr/lib/p7zip

Not so good... too much hits: 
"/lib/pkcs11 /usr/lib/pkcs11" are already in "/lib /usr/lib"


-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK         
Universitaet Stuttgart         E-Mail: horlacher@tik.uni-stuttgart.de
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    http://www.tik.uni-stuttgart.de/
REF:<20200130181516.GA29782@tik.uni-stuttgart.de>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

             reply	other threads:[~2020-01-30 18:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30 18:16 Ulli Horlacher [this message]
2020-01-30 18:26 ` Eric Blake
2020-01-31 10:18   ` Ulli Horlacher
2020-01-31 14:59     ` Brian Inglis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200130181516.GA29782@tik.uni-stuttgart.de \
    --to=framstag@rus.uni-stuttgart.de \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).