Command
wc
Explanation
wc counts lines, words, and characters in files.
Examples
Count lines, words, characters
wc file.txt
Count lines only
wc -l file.txt
Count words only
wc -w file.txt
wc
wc counts lines, words, and characters in files.
Count lines, words, characters
wc file.txt
Count lines only
wc -l file.txt
Count words only
wc -w file.txt