<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Cloc on YT Por</title><link>https://www.ytpor.com/tags/cloc/</link><description>Recent content in Cloc on YT Por</description><generator>Hugo -- 0.163.3</generator><language>en-us</language><lastBuildDate>Tue, 30 Jun 2026 10:00:00 +0800</lastBuildDate><atom:link href="https://www.ytpor.com/tags/cloc/index.xml" rel="self" type="application/rss+xml"/><item><title>Counting Lines of Code with cloc</title><link>https://www.ytpor.com/2026/06/calculate-lines-of-code-using-cloc/</link><pubDate>Tue, 30 Jun 2026 10:00:00 +0800</pubDate><guid>https://www.ytpor.com/2026/06/calculate-lines-of-code-using-cloc/</guid><description>&lt;p&gt;&lt;code&gt;cloc&lt;/code&gt; counts source lines of code across a project, separating code lines from comment lines and blank lines. For most reporting purposes - cost estimation, change tracking, and audits - only the code line count matters.&lt;/p&gt;
&lt;p&gt;Install it with Homebrew on macOS, APT on Debian/Ubuntu, or Chocolatey on Windows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;brew install cloc &lt;span style="color:#75715e"&gt;# macOS&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt install cloc &lt;span style="color:#75715e"&gt;# Debian / Ubuntu&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;choco install cloc &lt;span style="color:#75715e"&gt;# Windows&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Run it from the project root and exclude dependency and generated directories. Without exclusions, vendored libraries and build artifacts inflate the count. The directories to exclude depend on the ecosystem.&lt;/p&gt;</description></item></channel></rss>