<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://www.bytemycode.com/rssformat.xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>byteMyCode: Snippets for Code</title>
		<link>http://www.bytemycode.com</link>
		<description>Snippets for this tag.</description>
		<pubDate>Wed, 09 Jul 2008 03:08:42 +0000</pubDate>
		<copyright>1998-2008 </copyright>
		<language>en-us</language>
		<image>
		      <link>http://www.bytemycode.com</link>
		      <url>http://www.bytemycode.com/img/rss_title.gif</url>
		      <title>byteMyCode</title>
		</image>

	<item>
	<title>Code Counter</title>
	<link>http://www.bytemycode.com/snippets/snippet/362/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/362/comments/</comments>
	<pubDate>Thu, 14 Sep 2006 13:45:16 +0000</pubDate>
	<dc:creator>dohpaz</dc:creator>
	<category>bash, Code, Comments, Grep, Sed</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/362/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Thu. Sep. 14th, 2006  1:45 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/362/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/dohpaz/" title="Helper">dohpaz</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/bash">bash</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Code">Code</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Comments">Comments</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Grep">Grep</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Sed">Sed</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/362/comments/">0 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 7
			<p>I found this script online, and decided that I would modify it for my needs. As a developer, I like to know how many actual lines of code I have written--not including any comments.<br /><br />It outputs in a very simple way:<br /><br />Including Comments:   NNN<br />Without Comments:    NNN<br /><br />One very practical, and quick, way to determine how many lines of code a project has is to pipe it through a find:<br /><br /><br />find /usr/share/php -name "*.php" -o -name "*.inc" | xargs count-code<br /><br /><br />If your code is in files of another type (i.e., .c, .h, .cpp, etc), then simply change the extensions and add more '-o -name "*.ext"' tags. If you have directories that you don't want to be counted, simple throw a "| grep -v [path/to/excluded/directory] |" inbetween the find and the xargs, and they will not be counted.</p>
		]]>
	</description>
</item>
	</channel>
</rss>