Re: [dev] coreutils / moreutils - DC a directory counter

From: Strake <>
Date: Thu, 18 Jul 2013 10:57:31 -0500

On 17/07/2013, Calvin Morrison <> wrote:
> I came up with a utility[0] that i think could be useful, and I sent
> it to the moreutils page, but maybe it might fit better here. All it
> does is give a count of files in a directory.

$ ls | wc -l

> I was sick of ls | wc -l being so damned slow on large directories, so
> I thought a more direct solution would be better.
> calvin_AT_ecoli:~/big_folder> time ls file2v1dir/ | wc -l
> 687560
> real 0m7.798s
> user 0m7.317s
> sys 0m0.700s

$ time sh -c 'ls test | wc -l'
sh -c 'ls test | wc -l' 0.99s user 0.21s system 100% cpu 1.193 total

No bother here. Not sure why yours is so slow.

> I know there is a naming conflict, what does that have to do with the
usage of the program?

Much; I call it by name.

> What was the last time you used the reverse polish notation calculator
that precedes the invention of C?

Received on Thu Jul 18 2013 - 17:57:31 CEST

This archive was generated by hypermail 2.3.0 : Thu Jul 18 2013 - 18:00:07 CEST