Lines of Code?

Want to know how many lines of code your project is? Run this command:

find . -name '*.[hm]' -exec cat {} \; | wc -l

Note: Header files in your project build directories can skew the result, you might want to empty out your build directories before running this. Change the file extensions in [hm] if you want to run this one something other than a Cocoa project.


One Response to “Lines of Code?”  

  1. 1 ak

    Have you heard about SLOCCount? http://www.dwheeler.com/sloccount/
    It does that job a bit better, since it doesn’t count comments and blank lines, and even prints out a few estimations about the project effort, schedule and costs.

Leave a Reply