In your shell, or Terminal on a Mac, type:

wc -l filename

.. replacing filename with the actual name of the file. This should print the number of lines like so:

$ wc -l test.php 
      18 test.php
John John (304)
2 minutes

This short guide will show you how to change you default shell on unix based operating systems.