Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Apr 2006 12:12:46 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        David Robillard <davidencavale@hotmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Help clarify the '-l' option of ls(1).
Message-ID:  <20060412171246.GA89228@dan.emsphone.com>
In-Reply-To: <BAY107-F329581CF499F83C9C27406A6C20@phx.gbl>
References:  <BAY107-F329581CF499F83C9C27406A6C20@phx.gbl>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Apr 12), David Robillard said:
> I'd like to have an explication about the '-l' (minus L) option of
> the ls(1) command. What exactly is the signification of the second
> column in the display? The man page states that it is 'the number of
> links'. But what does it mean exactly?

It means "the number of links".

$ pwd
/tmp/z
$ touch a
$ ln a b
$ ls -la

total 4
drwxr-xr-x  2 dan   wheel  512 Apr 12 12:09 .
drwxrwxrwt  8 root  wheel  512 Apr 12 12:09 ..
-rw-r--r--  2 dan   dan      0 Apr 12 12:09 a
-rw-r--r--  2 dan   dan      0 Apr 12 12:09 b

"a" and "b" both have a link count of 2.  "." has a link count of 2
because it also exists in /tmp as "z".  ".." has a link count of 8
because it also exists as "." in /tmp, plus as "tmp" in /, plus as ".."
in 5 other subdirectories off /tmp.

-- 
	Dan Nelson
	dnelson@allantgroup.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060412171246.GA89228>