15. wc and nl
The wc (word count) command shows the total count of words in a file.
$ wc /etc/passwd
96 265 5925 /etc/passwd
It display the number of lines, number of words and number of bytes, respectively.
To just see just the count of a certain field, use the -l, -w, or -c respectively.
$ wc -l /etc/passwd
Another command you can use to check the count of lines on a file is the nl (number lines) command.
$ nl file1.txt
How would you get the total count of lines by using the nl file without searching through the entire output? Hint: Use some of the other commands you learned in this course.
What command would you use to get the total number of words in a file and just the words?