wc [options] [files]Word count. Print a character, word, and line count for files. If multiple files, print totals as well. If no files are given, read standard input. See other examples under ls and sort.
-cPrint byte count only.
-CPrint character count only. This will be different than -c in a multibyte character environment. Solaris only.
-lPrint line count only.
-mSame as -C. Solaris only.
-wPrint word count only.
Count the number of users logged in:
who | wc -l
Count the words in three essay files:
wc -w essay.[123]
Count lines in file named by $file (don't display filename):
wc -l < $file