Difference between revisions of "Wc"

From NovaOrdis Knowledge Base
Jump to: navigation, search
(Created page with "=Internal= * Linux =Options= ==-l== The number of lines in each input file is written to the standard output. ==-c== The number of bytes in each input...")
 
(-c)
Line 12: Line 12:
  
 
The number of bytes in each input file is written to the standard output.  This will cancel out any prior usage of the [[#-m|-m]] option.
 
The number of bytes in each input file is written to the standard output.  This will cancel out any prior usage of the [[#-m|-m]] option.
 +
 +
wc -c somefile.txt | awk '{print $1}'
  
 
==-m==
 
==-m==

Revision as of 23:31, 15 January 2020

Internal

Options

-l

The number of lines in each input file is written to the standard output.

-c

The number of bytes in each input file is written to the standard output. This will cancel out any prior usage of the -m option.

wc -c somefile.txt | awk '{print $1}'

-m

The number of characters in each input file is written to the standard output. If the current locale does not support multibyte characters, this is equivalent to the -c option. This will cancel out any prior usage of the -c option.

-w

The number of words in each input file is written to the standard output.