Updated: October 28, 2024 |
Count words, lines, and bytes (POSIX)
wc [-chlmtw] [file...]
QNX Neutrino
For each input file, the wc utility counts lines, words, characters, and bytes in the file and writes the results to the standard output. It considers a word to be a string of characters delimited by white space.
If you don't specify any options, wc writes counts of lines, words and bytes, in that order. If you specify one or more of the options -l, -w, -m, or -c, the wc utility reports only the information selected for the specified options. The order in which you specify these options determines the order in which the number of lines, words, characters, and bytes are written.
If you specify more than one input file, wc also writes a total count for all named files, for each option. You can specify the -t option to suppress the totals.
To get its line count, wc counts newline characters. If the last line of a file lacks the newline terminator, it isn't counted.