Although this number may mean nothing at all, counting the total number of Source Lines of Code (SLOC) can be fun. Here is how you can tally up all the lines of PHP you have in a project from the command line:
find . -regex '.*\.\(php\)' -print0 | xargs -0 cat | wc -l
You can read more about this on wikipedia.




The following script does a little better job. Try it. If you don’t have biterScripting, download it from http://biterscripting.com/
By P Mc on Dec 13, 2008