cloc--Source Code counting tool

Source: Internet
Author: User

Today, listen to a colleague said that there is a cloc tool can also quickly count the number of lines of source code so, I went to understand the next, of course, this tool is written in Perl open source tools, it must be said that the GNU Open Source Foundation and Epel are a good platform, Of course, the GNU official website can also be downloaded to the Cloc source package, but in order to use the configuration of the system directly in the installation of Yum to install, note that the general configuration of Yum is not downloadable, you must add the Epel configuration in the image to use Yum to install Cloc, Of course, it is recommended to use the system is already in use of the Yum image source, of course, I use the source of Ali, you can go to the source image of Ali download Epel configuration file, yum Repo file address is as follows: http://mirrors.aliyun.com/repo/ Download the repo file for your system in Yum Makecache generate the next meta-data, directly yum-y install Cloc installation can be, Cloc is written in Perl so must be Perl's dependence, And we usually count the number of lines of code in a project under a folder is also very simple

[email protected] scripts]# cloc /usr/local/scripts/        2 text files.       2 unique files.                                       0  files ignored.http://cloc.sourceforge.net v 1.58  t=0.5 s  (4.0 files/s ,  26.0 lines/s)------------------------------------------------------------------------------- language                      files          blank         comment            Code-------------------------------------------------------------------------------bourne shell                      2               3               0              10-------------------------------------------------------------------------------sum:                               2               3               0             10----------------------- -------------------------------------------------------- 

This allows for quick statistics on the number of lines of code, CLOC also supports more than 100 language recognition support

[Email protected] scripts]# Cloc--show-lang|wc-l107

Of course, the real purpose of cloc is not only used to count the number of lines of code and other information, it can also be used in comparison with the file and diff is the same, of course, want to know more ways to see the man cloc get more information

This article from the "Technical essay" blog, reproduced please contact the author!

cloc--Source Code counting tool

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.