[Top][All Lists]

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

Re: find -links n

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

Thanks for clarification, now I can reconstruct that better.
Should I mark the question as solved? If yes, how?

Am 16.07.2013 09:21, schrieb James Youngman:
On Sun, Jul 14, 2013 at 8:49 PM, Günter Wallnig <address@hidden> wrote:
Hello James,
here are some more details:
ls -il
164407 drwxr-x--- 2 guenter guenter   4096 2013-07-14 11:23 Ablage
it's a directory

find -links 2
this directory is't linked anyway. There are no files or other directories
Empty directories on normal Unix-like file systems have a link count
of 2.  This is because they contain an entry called "." which points
to the directory itself, as well as the directory entry in the parent.

If you take an empty directory and create a sub-directory inside it
you will also see that the new child's ".." entry (which points to the
new child's parent) causes the link count on the parent to change from
2 to 3.

There is a clearer description of this, with a diagram, in section
4.14 of Richard Stevens' "Advanced Programming in the UNIX
Environment", a book I'd strongly recommend.   There's also a somewhat
less clear but useful explanation at

Am 14.07.2013 21:18, schrieb James Youngman:
On Sun, Jul 14, 2013 at 11:19 AM, Günter Wallnig <address@hidden> wrote:
Hello, people,

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!

Sincerely yours
G. Wallnig

Please excuse my bad English!
I'm sorry, but from what you wrote I'm not able to understand the
problem you're trying to point out.  Please try again, providing more

What command did you use, precisely?
see above
What result did you expect, precisely?
only real (hard) linked files

What result did you get, precisely?
see above
Why do you think that's wrong?
I think, the command is normally used to find linked files. directories
can't hard linked ... a soft link doesn't exist there. The directory is

Which version of GNU findutils are you using?
find --version
find (GNU findutils) 4.4.2
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Erzeugt mit der GNU gnulib Version
Aktivierte Eigenschaften: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION
FTS() CBO(level=0)

Can you reproduce the same effect using the newest version on
there are no newer version

Here are some more information about system:

uname -r

cat /proc/version_signature
Ubuntu 2.6.38-16.67-generic

cat /etc/debian_version

cat /etc/lsb-release

I hope this helps?

reply via email to

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