Pavel Tashev
Pavel Tashev / Entrepreneur and Software Developer
Constantly learning new things. I love to be part of projects and StartUps that inspire me and improve the life of society.
Contact me via LinkedIn
Isle of Man, UK and Bulgaria
Counting lines of code (LOC) in PHP projects

Counting lines of code (LOC) in PHP projects

CLOC is a great tool which shows you the number of lines of code in your project and also the number of files, blank lines, comment lines, etc. It’s a great tool for your Linux environment!

First we have to install it. For Debian/Ubuntu:

apt-get install cloc

For CentOS/RedHat:

yum install cloc

CLOC does not require configuration and the running is simple:

cloc your-folder/

“your-folder” contains the files or your project.

Here is an example run of CLOC:

As you have already noticed, CLOC recognizes different languages like PHP, LESS, JavaScript, etc. and counts the lines of code for each of them, which is a great feature for more detail statistics.

That’s from me for now. As always, any feedback in the comments is welcome!

Share me please:

Leave a Reply

two × 3 =

bCH3gl

Please type the text above: