Original link: http://www.cnblogs.com/kevingrace/p/6768005.html
In day-to-day operations, you will encounter a project in the number of lines of code for the needs of statistics, the following number of lines of code to comb the statistical methods for reference.
1 The simplest is the use of wc-l directly to the number of lines of code statistics. (Explanation of several parameters of WC:-C statistic byte number;-l statistic line number;-W statistic word count)
| 1 2 3 4, 5 6 7 8 9 10 11 12 13 14 15 |
1) Statistics The current directory of the number of index.php files [root@huanqiu_web1 ~] # cat index.php |wc-l 17 2) Statistics web directory, JS file number: [Root@huanqiu_web1 ~] # fin D web/-name "*.js" |WC-L 3 Statistics web directory of all JS file code lines: [Root@huanqiu_web1 ~] # find web/-name ' *.js ' |xargs cat|wc-l or WC- L ' Find web/-name ' *.js ' |tail-n1 |