1 First of all you need to download a copy of the Perl script Cloc. You can get it from http://sourceforge.net/projects/cloc/files/ — the latest version is 1.53.
2 Download the script (if you have copied and pasted it from the browser window, make sure you give it the .pl Perl extension).
3 Next, open up Terminal.app and navigate to the script. I put mine in a folder called ‘TerminalScripts’ in my home folder, so…
…gets me there.
4 Run the cloc script, referencing the folder containing the project you want to analyse eg:
perl cloc-1.53.pl /Users/duncan/Webserver/OxfordTravelGuide-SVN
And that’s it, simple!