Count lines in directory On Linux, find . -name '*.php' | wc -l. Or on Mac or Linux, xxx install cloc, run cloc ..