bug-findutils
[Top][All Lists]
Advanced

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

Fwd: Re: find -links n


From: Günter Wallnig
Subject: Fwd: Re: find -links n
Date: Tue, 16 Jul 2013 13:03:31 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121011 Thunderbird/16.0.1

Please apologetic errors mean with the answer, I retrieve the answer to the list hereby.

-------- Original-Nachricht --------
Betreff:        Re: find -links n
Datum:  Tue, 16 Jul 2013 12:57:16 +0200
Von:    Günter Wallnig <address@hidden>
An:     Bernhard Voelker <address@hidden>


Hello Bernhard,
thanks for your answer.

Am 15.07.2013 10:03, schrieb Bernhard Voelker:
On 07/14/2013 12:19 PM, Günter Wallnig wrote:
I believe to have found a mistake in "find" with the param "-links":

Apparently, only the second Column of the output of "ls" looks at what
is probably wrong with a directory!
If I understand correct, then you are saying that the second column of
the "ls"-formatted output shows a different number than the number you
have been searching for with "-links N", e.g.

   $ find -links 5 -ls
   17311045    4 drwxr-xr-x   5 berny    users        4096 Dec  9  2011 
./gnulib/.git/refs
   15481120    4 drwxr-xr-x   5 berny    users        4096 Dec  9  2011 
./.git/refs
   16913157    4 drwxr-xr-x   5 berny    users        4096 Mar 27 19:57 
./find/testsuite
   22825398   32 drwxr-xr-x   5 berny    users       32768 Mar 27 19:56 ./tests

This is the output format of "ls -dils" as mentioned in the manual.
The 2nd column isn't the number of links but instead the number of
1k-blocks used for this file/directory.

I understand, what you meaning, but has your directories 5 links? Can
only be soft link?

I have used different options, only -il ... so give me a "2" in output
$ ls -il |grep Ablage
164407 drwxr-x--- 2 guenter guenter 4096 2013-07-14 11:23 Ablage
my shown directory "Ablage" has no content nor is linked anyway!

With the following command I got
$ find -links 2 |grep Ablage
./Ablage
that is in my opinion wrong, because the used directory does not have
links! Nor any files or directories, it's empty.

I falsely assumed that the number "2" in the 3rd column information over
the number of links, particularly since the output of the next command
let that assume this

The number of links is in column 4.
my output looks similar
$ find -links 2 -ls |grep Ablage
164407 4 drwxr-x--- 2 guenter guenter 4096 Jul 14 11:23 ./Ablage
Thus does the normal command “ls” probably supply wrong information?
But I found here also a sign of linked in column 4!

Version of my ls
$ ls --version
$ ls (GNU coreutils) 8.5
Copyright © 2010 Free Software Foundation, Inc.
Lizenz GPLv3+: GNU GPL Version 3 oder höher
<http://gnu.org/licenses/gpl.html>

Geschrieben von Richard M. Stallman und David MacKenzie.

But nevertheless the wrong output of the command “find --links 2”… it
shouldn’t anything show, in particular no directory?

There are no hard links in the current directory, if I produce however
one, gets I:
$ ln Wichtiges.txt Test.txt

$ find -links 2 -ls |grep txt
164426 4 -rw-r----- 2 guenter guenter 1842 Jul 14 22:53 ./Wichtiges.txt
164426 4 -rw-r----- 2 guenter guenter 1842 Jul 14 22:53 ./Test.txt
that looks correct ... and more examples in same directory:
$ find -links 2 -ls |grep -w 2
164426 4 -rw-r----- 2 guenter guenter 1842 Jul 14 22:53 ./Wichtiges.txt
164331 4 *d*rwxr-x--- 2 guenter guenter 4096 Jul 7 17:58 ./Bescheid
164426 4 -rw-r----- 2 guenter guenter 1842 Jul 14 22:53 ./Test.txt
164375 4 *d*rwxr-x--- 2 guenter guenter 4096 Jul 7 17:55 ./Sonstiges
164409 24 -rw-r----- 2 guenter guenter 20673 Jun 30 15:53
./Sonstiges/Einkauf.ods
164407 4 *d*rwxr-x--- 2 guenter guenter 4096 Jul 14 11:23 ./Ablage
164330 4 *d*rwxr-x--- 2 guenter guenter 4096 Jul 12 23:59 ./Elster
164409 24 -rw-r----- 2 guenter guenter 20673 Jun 30 15:53 ./Einkauf.ods

$ find -samefile Test.txt
./Wichtiges.txt
./Test.txt

$ find -samefile Einkauf.ods
./Sonstiges/Einkauf.ods
./Einkauf.ods

Again, please excuse my bad English, it's not my native language.

Greetings from Berlin in Germany
Günter







reply via email to

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