Total Number of lines in the kernel code

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Thu Mar 27 23:34:48 EDT 2014


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 :)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140327/9cf1ae19/attachment.bin 


More information about the Kernelnewbies mailing list