The wc command is used to count the lines, words, and characters in a file by default. It can accept -l, -w, or -c options to display only the lines, words, or characters respectively. The filename is passed as an argument to the wc command, as shown in the following screenshot: