How to count number of line in project

How to count number of line in project
November 23, 2018 No Comments Development,Research And News Pushpendra Kumar



Let’s have look on the new thing today. How to count the number of lines in existed project or in a particular file. The question occurs in my mind when my Bose asked me that how many lines you have coded in your project. Then I start searching on that and I found the very simple solution for this problem. And if you know the extension of your files which exists into the project then it’s very easy and simple like cream! So let’s start with the following procedure.

Open your terminal now reach your project folder location with cd command in your terminal for Mac and Command Prompt for Window system. Now write the following line as per your requirement.

This is for PHP
find . -name '*.php' | xargs wc -l
This is for Javascript
find . -name '*.js' | xargs wc -l
This is for CSS
find . -name '*.css' | xargs wc -l



This is for HTML
find . -name '*.html' | xargs wc -l
This is for JAVA
find . -name '*.java' | xargs wc -l
This is for CLASS
find . -name '*.class' | xargs wc -l
This is for XML
find . -name '*.xml' | xargs wc -l
This is for C
find . -name '*.c' | xargs wc -l

Hopefully you have notice that, with this simple command you can easily find the number lines in your project with the particular extension. You can try with more extensions.

Good Luck 🙂 Happy Coding


Tags
About The Author
Pushpendra Kumar I am passionate about mobile application development and professional developer at Colour Moon Technologies Pvt Ltd (www.thecolourmoon.com). This website I have made so that I can meet with new challenges and can share here.

Leave a reply

Your email address will not be published.