Casper's solution is nicer, avoiding the grep -v. – jfgagneAug 10 '11 at 18:47
jfgagne, If you consider his solution as better, upvote it. My solution is easier to understand and to modify - I think it is better to begginner. Casper's needs a deep knowledge of the find command, and my needs only basic options of find, grep, xargs, wc. – osgxAug 10 '11 at 19:23
Also, -print0 is unportable, according to pubs.opengroup.org/onlinepubs/009695399/utilities/find.html "Other implementations have added other ways to get around this problem, notably a -print0 primary that wrote filenames with a null byte terminator. This was considered here, but not adopted. " – osgxAug 10 '11 at 19:26
As osgw pointed out, using -print and piping to xargs cat | wc -l might be more portable, but I like avoiding many greps and avoiding going down uselessly in directories. If you do not have read permission on those directories, lots of warning are avoided. +1, and I think it should be the accepted solution. – jfgagneAug 10 '11 at 19:46