This recursively lists the contents of directories, then, using 'grep -v', discards lines starting with './' and 'total' and 'd' and empty lines. The results are piped through 'wc' to get the number of lines remaining.
Oh yeh... this is on Solaris. Maybe slightly different for Linux or HP-UX or other, but probably not.