Wednesday, December 10, 2008

Count lines of code in a file on Linux

Handy tool I found out about yesterday to count the amount of lines in a file:

wc -l yourfile.c

This will print out the number of lines in the file. It would be nice if it worked in a directory (especially as I had to give a rough count of a fairly large piece of software), but wc is better than doing it by using vi.

For more information: man wc

No comments: