How many lines in your PHP project without comments

find . -type f -name '*.php' | xargs cat | sed -re ':top /\/\*.*\*\// { s/\/\*.*\*\///g ; t top }; /\/\*/ { N ; b top }' | awk '$0 !~ /^[\t[:space:]]*($|(\/\/)|(#))/' | wc -l
An advanced possibility to count the lines of code like in #8394
Sample Output
andre@klaus:~/CVS/unitime/unitimeweb/unitime$ find . -type f -name '*.php' | xargs cat | sed -re ':top /\/\*.*\*\// { s/\/\*.*\*\///g ; t top }; /\/\*/ { N ; b top }' | awk '$0 !~ /^[\t[:space:]]*($|(\/\/)|(#))/' | wc -l

By: andrehgw
2011-05-05 06:12:34

What Others Think

Great posts, I am a student and take classes of android. I have also many problems and I am searching the answer of these problems but I didn't got the proper answer Black Friday Coupons .I am glad that you are providing such a great platform where I can discuss my issues regarding coding. Thanks for the good post, keep posting.
sophiacharles · 202 weeks and 3 days ago
Coding and decoding has become very important in this technological world. But as you it is never easy to learn the process of coding and now students can cheap assignment writing help to manage their task. Thanks for providing platform that guides one towards the minor issues that arise while the learning process.
LuciaLemke · 81 weeks and 5 days ago
This command is so simple, but it is very effective. I love programming, so I went to college to study programming. But before I entered, I hesitated for a long time whether to go to college or not. So at [url=][/url]. I found a lot of essays on "is college worth it" and decided I wanted to study. On you will find essays on any topic and they are all very high quality. You will be as happy as I am. Now I study in college and study such cool things as presented here.
KurtWoodard · 78 weeks and 3 days ago
Sometimes you also need to write a text part for the project. If you are a programmer from head to toe, then it is better to contact service so that the writers write the text part for you.
JanetteeTurnerr · 53 weeks and 5 days ago
Are you going to send your paper to your teacher today, but you haven't even written a word yet? Don't worry, we have a way! You've happened to find the academic institution you've been looking for for so long! We are a reliable article writing company that provides various academic services and tutorials for Chinese students in the United States, UK, Canada, Australia and New Zealand.
illianna · 24 weeks ago
It was so good to see the command line interface you have specified here. This website will helps you to create various Benefits Of Smoking Hemp CBD commands and through which you can simplify the codes that are used in other programming languages. Various tasks can be performed using these simple codes.
Alyssalauren · 23 weeks and 6 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: