Counting lines, words, and bytes in a file
The wc command tells
you how big a text document is.
wc file file ...
tells you
the number of lines, words, and bytes in each file.If you want to find out how many files are in a directory, enter:
ls | wc
This pipes the output of ls through wc.
Because ls prints one name per line when its output is being
piped or redirected, the number of lines is the number of files and
directories under your working directory.