word count wc

Count Number of Lines in a File

Back to basics with this one, the linux wc command (word count) can be used to count lines, words and bytes in a file and it does it lightning fast. Many times it’s also combined with other commands to get the results you want.

Number of lines in a file

 

Number of words in a file

This isn’t a very useful command as is, but it will return a count of all words, a word is any contiguous non whitespace character(s) separated by a whitespace character.

 

Number of characters in a file