sperry.ace Posted January 12, 2009 Share Posted January 12, 2009 Hello, i have some .c files in different folder under /code/ and i want to find the number of lines of code ( LOC ) of all those files. i tired doing wc -l | find *.c /code/ but its not giving the correct out . ie., number of lines all in total. Thanks ~Ace Quote Link to comment Share on other sites More sharing options...
trq Posted January 12, 2009 Share Posted January 12, 2009 cat /code/*.c | wc -l Quote Link to comment Share on other sites More sharing options...
sperry.ace Posted January 12, 2009 Author Share Posted January 12, 2009 This is not wokring - this will pring the files in same folder and not recursively. please note that there are severrel files like /code/abc.c /code/A/test.c /code/B/main.c /code/c/d/inc.c ~Ace Quote Link to comment Share on other sites More sharing options...
trq Posted January 12, 2009 Share Posted January 12, 2009 find /code -name '*.c' -exec cat {} \; | wc -l Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.