wc-counts lines, words, and characters

 <  Day Day Up  >  

wc ”counts lines, words, and characters

 wc [ lwc ] [ filename ... ] 

wc counts lines, words, and characters in a file or in the standard input if no filename is given. A word is a string of characters delimited by a space, tab, or newline.

Example A.69.
 1   wc filex 2   who  wc -l 3   wc -l filex 

EXPLANATION

  1. Prints the number of lines, words, and characters in filex .

  2. The output of the who command is piped to wc , displaying the number of lines counted.

  3. Prints the number of lines in filex .

 <  Day Day Up  >  


UNIX Shells by Example
UNIX Shells by Example (4th Edition)
ISBN: 013147572X
EAN: 2147483647
Year: 2004
Pages: 454
Authors: Ellie Quigley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net