On Fri, Mar 28, 2014 at 9:04 AM, <Valdis.Kletnieks@vt.edu> wrote:
On Fri, 28 Mar 2014 08:49:55 +0530, Kaushal Shriyan said:

> How many lines of code and files and directories in the latest stable
> kernel 3.13.7?

find, xargs, and wc are your friends. For Linus's 'git' tree (3.14-rc8-ish):

[/usr/src/linux] find * -type d | wc -l
2947
[/usr/src/linux] find * -type f | wc -l
46016
[/usr/src/linux] find * -type f -name '*.[ch]' | xargs cat | wc -l
16644991

(Ignoring of course that there's other types of lines of code besides *.c
and *.h.  If you don't like it, do your own find command :)



Thanks Valdis for the explanation