http://dsl.org/cookbook/cookbook_16.html
To output the number of lines in the file outline.txt, type:
outline.txt
wc -l outline.txt
To find the number of lines in the file outline.txt that contain the string chapter, type:
chapter
grep chapter outline.txt | wc -l