How to the number of lines of code in files (files being in a text editor when loading a project)

The interesting thing about counting lines of code is that you have to specify what type of files you want to read. For example, a project with pictures will increase the lines of code count by a substantial number. I’ll explain more after a few instructions on how to actually execute commands in the terminal to get a count:

1. $wc -l ‘find . -name \*.html -print’………..this equates to english as “word count lines find in the current directory where the name is anything .html and print the names of files with the number of lines”

.py (python) files: 6572 lines

.html files: 2774 lines

.css files: 8410 lines

total: 17756 lines

Now if I did not execute the commands individually specifying for .html then .css then .py the total number of lines counted was over 300,000 primarily since it counted everything including pictures as lines (not sure what else at this point).


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s