WC(1,C) AIX Commands Reference WC(1,C) ------------------------------------------------------------------------------- wc PURPOSE Counts the number of lines, words and characters in a file. SYNTAX +----- -cwl ------+ +--------+ wc ---| one of |---| |---| | +-------------+ | +- file -+ +-| -c -cl -cwl |-+ ^ | | -l -cw | +------+ | -w -lw | +-------------+ DESCRIPTION The wc command counts the number of lines, words, or characters in file or in the standard input if you do not specify any files. It writes the results to standard output. It also keeps a total count for all named files. A word is defined as a string of characters delimited by spaces, tabs, or new-line characters. wc counts lines, words, and characters by default. When you specify more than one file on the command line, wc displays the name of the file along with the counts. FLAGS -c Counts bytes. -l Counts lines. -w Counts words. EXAMPLES 1. To display the line, word, and character counts of a file: wc chap1 This displays the number of lines, words, and characters in the file "chap1". 2. To display only character and word counts: wc -cw chap* Processed November 8, 1990 WC(1,C) 1 WC(1,C) AIX Commands Reference WC(1,C) This displays the number of characters and words in each file whose name starts with "chap", and displays the totals. Processed November 8, 1990 WC(1,C) 2