bash wc command code example

Example 1: wc bash

wc(1) - print newline, word, and byte counts for each file

Print  newline, word, and byte counts for each FILE, 
and a total line if more than one FILE is specified.
With no FILE, or when FILE is -, read standard input.  
A word is a non-zero-length sequence of characters
delimited  by  white  space.  The options below may be 
used to select which counts are printed, always in the 
following order: newline, word, character, byte, maximum 
line length.

-l, --lines
       print the newline counts

Example 2: linux wc list of files

find ./ -type f -name "*work*" -exec wc -w {} +

Tags:

Html Example