wc

wc - print newline, word, and byte counts for each file.


Display number of lines:

wc -l /etc/passwd

Display number of words:

wc -w /etc/passwd

Display byte counts:

wc -c /etc/passwd

Display the character counts:

wc -m /etc/passwd

Display the length of the longest line:

wc -L /etc/passwd