Wc

The wc (think word count) command counts the lines (strictly the number of newline characters, which may be one less if the last line does not end in a newline character), words, and bytes in a file:

[email protected]:~ > cat file the quick brown fox jumped over the lazy dog [email protected]:~ > wc file 2 9 44 file

The file has 2 newline characters, 9 words, and 44 characters in all (made up of 36 letters, 6 spaces, and the 2 newline characters; there is no newline character at the end of the file).

Was this article helpful?

0 0

Post a comment