1 .\" $OpenBSD: wc.1,v 1.27 2016/10/24 13:46:58 schwarze Exp $
3 .\" Copyright (c) 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" This code is derived from software contributed to Berkeley by
7 .\" the Institute of Electrical and Electronics Engineers, Inc.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
17 .\" 3. Neither the name of the University nor the names of its contributors
18 .\" may be used to endorse or promote products derived from this software
19 .\" without specific prior written permission.
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" from: @(#)wc.1 8.2 (Berkeley) 4/19/94
35 .Dd $Mdocdate: October 24 2016 $
40 .Nd word, line, and byte or character count
49 utility reads one or more input text files and, by
50 default, writes the number of lines, words, and bytes
51 contained in each input file to the standard output.
52 If more than one input file is specified,
53 a line of cumulative count(s) for all named files is output on a
54 separate line following the last file count.
56 considers a word to be a maximal string of characters delimited by
58 Whitespace characters are the set of characters for which the
60 function returns true.
62 The options are as follows:
65 The number of bytes in each input file
66 is written to the standard output.
68 The number of lines in each input file
69 is written to the standard output.
71 Count characters instead of bytes, and use
76 The number of words in each input file
77 is written to the standard output.
80 When an option is specified,
82 only reports the information requested by that option.
83 The default action is equivalent to the flags
85 having been specified.
87 If no file names are specified, the standard input is used
88 and a file name is not output.
89 The resulting output is one
90 line of the requested count(s) with the cumulative sum
91 of all files read in via standard input.
93 By default, the standard output contains a line for each
94 input file of the form:
95 .Bd -literal -offset indent
96 lines words bytes file_name
99 The counts for lines, words, and bytes
101 are integers separated by spaces.
103 .Bl -tag -width LC_CTYPE
105 The character encoding
107 It decides which byte sequences form characters.
111 or an unsupported value,
113 has the same effect as
123 utility is compliant with the