Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Dec 2002 10:10:44 +0100
From:      Roman Neuhauser <neuhauser@bellavista.cz>
To:        FreeBSD LIST <freebsd-questions@FreeBSD.ORG>
Subject:   Re: File Counts
Message-ID:  <20021203091044.GF56031@freepuppy.bellavista.cz>
In-Reply-To: <Pine.BSF.4.50.0212022124070.85843-100000@earl-grey.cloud9.net>
References:  <C21B13C8-0652-11D7-B566-000393681B06@lafn.org> <Pine.BSF.4.50.0212022124070.85843-100000@earl-grey.cloud9.net>

next in thread | previous in thread | raw e-mail | index | archive | help
# Hostmaster@Video2Video.Com / 2002-12-02 21:26:24 -0500:
> On Mon, 2 Dec 2002, Doug Hardie wrote:
> > Thanks to all who responded.  The approach below does just what I
> > needed.
> 
> Here's another way I don't see listed:
> 
> $ find . -type f | wc -l
> 
> This means "find, starting right here, all files here and in
> subdirectories - then pipe the output through word count just the
> lines."
> 
> You'd think FreeBSD would have a command similar to ls, df, du or a
> flag to the find command such as "-countitems" or something.

    count the keystrokes:

    find . -type f|wc -l
    find . -type f -countitems
 
    plus, -countitems switch would only work for find(1), obviously,
    while a pipe to wc(1) works with any output.

    of course, if you want to see the number of
    files/directories/symlinks in current directory, setup a function to
    compute them, and let your shell display the results in your prompt.

-- 
If you cc me or remove the list(s) completely I'll most likely ignore
your message.    see http://www.eyrie.org./~eagle/faqs/questions.html

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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