Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Fastest way to count # of files?
- X-seq: zsh-users 21857
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Fastest way to count # of files?
- Date: Fri, 9 Sep 2016 05:36:09 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=rAtw2P9Qe61A55Bv2cyBRqYTyqE=; b=MkBotN PJfx5QMTepku9ru1AfX8UiC8cTdAth2bGxKoZcR4/MW9ImF0u2hatY0ClUsvkMi5 bmFY8nwdwZTPMj6UjTcxI7cnMXYjaFYqQ2rVSoTyDVXQNVlgdvebxWDzJ3l2rXyi e4Ju+1Ow0/GSwBNAfPpDwn2ZSAuI/oIeriSl0=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=rAtw2P9Qe61A55Bv2cyBRqYTyqE=; b=KN2TQ Lb0a4zNjDVGun7l6ZelsJqfqYifm96FR/Kv3b5tCifiONAQ6tI6kVqj/nswp62Ro U3l5dIhvRnPwaPOMrjt17An41zdo7UF7968ohKXC59qQFXVeuBB5pQevpAiQZN5f Ze0h0JbHPQifg3Tn3YU+IS2khHBcgpuS/evUhc=
- In-reply-to: <160908180958.ZM14692__14483.1264777624$1473385001$gmane$org@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVApZGBAoQ4GywTLzbJXmNOrq2-W_iP7p+ifWqzYF49N+g@mail.gmail.com> <160908090800.ZM13466@torch.brasslantern.com> <CAKc7PVBE4tzYqdUXqZ8KpgFPq45Kx2z56_vMnST9oLsOH+YcEQ@mail.gmail.com> <CAH+w=7ZZzfF8t0Fho1pvUCMzQJuHDoVS=S3Mox7gpx08YyNhJQ@mail.gmail.com> <160908180958.ZM14692__14483.1264777624$1473385001$gmane$org@torch.brasslantern.com>
Bart Schaefer wrote on Thu, Sep 08, 2016 at 18:09:58 -0700:
> On Sep 8, 1:00pm, Bart Schaefer wrote:
> }
> } This assumes that nlink for a directory is the number of files it
> } contains plus "." and "..".
>
> Accuracy of this seems to vary by filesystem type, so probably not
> a viable solution.
nlink for a directory $d is usually the two plus number of subdirectories
$d has; it's unrelated to the number of files in $d. (A directory is
hard linked from its parent, from itself, and from each subdirectory of
itself, but not from files in it.)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author