Word Count(wc)
The wc (word count) command is used to find out number of line count, word count, byte and characters count in a files
The following are the options and usage provided by the command.
The wc (word count) command is used to find out number of line count, word count, byte and characters count in a files
The following are the options and usage provided by the command.
Running wc without any switch
The three numbers shown below are 10 (number of lines), 70 (number of words) and 340 (number of bytes) of the file.
Count Number of Lines
To count number of lines in a file use the option ‘-l‘.
To count number of lines in a file use the option ‘-l‘.
Count Number of Characters
To count number of characters in a file use the option ‘-c‘.
To count number of characters in a file use the option ‘-c‘.
Count Number of words
To count number of words in a file use the option ‘-w‘.
To count number of words in a file use the option ‘-w‘.
Length of Longest Line
To print out the length of longest (number of characters) line in a file.
To print out the length of longest (number of characters) line in a file.