[Gllug] # files in a subdir

Nix nix at esperi.demon.co.uk
Sun Sep 23 09:14:47 UTC 2001


On Fri, 21 Sep 2001, tet at accucard.com stipulated:
> 	find . -type f -print | wc -l
> 	find . -print | wc -l
> 
> to find and how many files and directories are there. For large
> directory trees, both of these will be faster than using du because
> it doesn't have to stat each file.

Not true except on recent Linux kernels (and FreeBSD?), and only then if
your find supports it (new ones do).

(After all, it still must stat each inode it sees to determine if it is
a directory or not, to recurse down it...)

-- 
`Upsetting this BOFH was a BAD MOVE.' --- Chris Newport

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list