Subj : Re: Getting the number of lines in a file To : comp.os.linux From : JRH Date : Fri Jul 23 2004 05:54 pm Joshua Beall wrote: > Hi All, > > What I really want to do is get the cumulative number of lines in many > files, recursing into subdirectories. I want to see how many lines of > code > are in the PHP project I am working on right now. I don't know of any > quick way of doing this, and I have even thought about writing a quick PHP > script that will do it for me, but I don't want to do that if there is a > bit of shell wizardry that would be able to accomplish this for me. Try something like: cat *.php | wc -l for a single dir, or if in multiple subdirs cat $(find . -iname '*.php') | wc -l For a count of non-blank lines interpose grep cat $(find . -iname '*.php') |grep -vE '^$' | wc -l (The possibilities are endless. Read the man pages for cat, wc, grep, wc ;-) ....John -- --------------------------------------------------- (Remove digits from my email address before use ;-) .