Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Wc (Unix)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Example== Sample execution of '''wc''': <syntaxhighlight lang="console"> $ wc foo bar 40 149 947 foo 2294 16638 97724 bar 2334 16787 98671 total </syntaxhighlight> The first column is the count of newlines, meaning that the text file <code>foo</code> has 40 newlines while <code>bar</code> has 2294 newlines- resulting in a total of 2334 newlines. The second column indicates the number of words in each text file showing that there are 149 words in <code>foo</code> and 16638 words in <code>bar</code>{{snd}} giving a total of 16787 words. The last column indicates the number of characters in each text file, meaning that the file <code>foo</code> has 947 characters while <code>bar</code> has 97724 characters{{snd}} 98671 characters all in all. Newer versions of <code>wc</code> can differentiate between [[byte]] and [[character (computing)|character]] count. This difference arises with [[Unicode]] which includes multi-byte characters. The desired behaviour is selected with the <code>-c</code> or <code>-m</code> options. Through a [[Pipeline (Unix)|pipeline]], it can also be used to preview the output size of a command with a potentially large output, without it printing the text into the console: <syntaxhighlight lang=console> $ grep -r "example" |wc 1071 23337 101349 </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)