Sorting out the method of counting code lines

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.