 <p>The other answers seem to have missed the source-control history side of things.</p> <p>From <a href="http://forums.perforce.com/index.php?/topic/359-how-many-lines-of-code-have-i-written/" rel="nofollow">http://forums.perforce.com/index.php?/topic/359-how-many-lines-of-code-have-i-written/</a></p> <p>Calculate the answer in multiple steps:</p> <p>1) Added files:</p> <pre><code>p4 filelog ... | grep ' add on .* by &lt;username&gt;' p4 print -q foo#1 | wc -l </code></pre> <p>2) Changed files:</p> <pre><code>p4 describe &lt;changelist&gt; | grep "^&gt;" | wc -l </code></pre> <p>Combine all the counts together (scripting...), and you'll have a total.</p> <p>You might also want to get rid of whitespace lines, or lines without alphanumeric chars, with a grep?</p> <p>Also if you are doing it regularly, it would be more efficient to code the thing in P4Python and do it incrementally - keeping history and looking at only new commits.</p>