News for hackers. Stuff that matters.
Re:Unix Commands I Wish I’d Discovered Years Earlier by dredmorbius on Tuesday September 10, 2013 @02:24PM (#6362018)
It's not the pipe through wc, but statting the directory entries which slows you down.

If your locatedb is current, you can use locate for this:

    $ locate $PWD | wc -l
That runs in just a hair under a second (0.908s real) for the first instance. 'find' takes a few seconds on first pass (it's got to read from disk), but is surprising fast (0.227s real) on subsequent runs.

So I guess it depends on whether you're doing it just once or multiple times.

There are no comments on this comment yet.