How to count the number of lines of code in Linux-general Linux technology-Linux programming and kernel information. For more information, see the following. When programming, we often want to count how many lines of code we have written. What should we do at this time?
Although Vim and other editors have lines of code displayed, they cannot be opened one by one and then added up?
The wc tool is required at this time. It is very powerful, though its name is not very good.
Usage:
In the current directory:
Wc-l *. c *. h
Current Directory and subdirectory:
Find.-name *. c | xargs wc-l
Find.-name *. cpp | xargs wc-l
Find.-name *. h | xargs wc-l
Is it convenient?
PS: no more than 600 lines of my Cugb Linker ...... Effort!
From day-dust: http://hi.baidu.com/ivenvd/blog/... 52690d18d81fef.html
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