98 lines
2.1 KiB
Groff
98 lines
2.1 KiB
Groff
.\" @(#)wc.1 1.1 94/10/31 SMI; from S5R2 6.2 83/09/02
|
|
.TH WC 1 "2 October 1989"
|
|
.SH NAME
|
|
wc \- display a count of lines, words and characters
|
|
.SH SYNOPSIS
|
|
.B wc
|
|
[
|
|
.B \-lwc
|
|
] [
|
|
.I filename
|
|
\&.\|.\|.
|
|
]
|
|
.IX "wc command" "" "\fLwc\fP \(em count lines, words, characters in file"
|
|
.IX "count lines, words, characters in file" "" "count lines, words, characters in file \(em \fLwc\fP"
|
|
.IX lines "count \(em \fLwc\fP"
|
|
.IX "words in file, count \(em \fLwc\fP"
|
|
.IX "characters in file, count \(em \fLwc\fP"
|
|
.IX file "count lines, words, characters in" "" "count lines, words, characters in \(em \fLwc\fP"
|
|
.SH DESCRIPTION
|
|
.B wc
|
|
counts lines, words, and characters in
|
|
.IR filename s,
|
|
or in the standard input if no
|
|
.I filename
|
|
appears. It also keeps a total count for all named files.
|
|
A word is a string of characters delimited by
|
|
.SM SPACE\s0,
|
|
.SM TAB\s0,
|
|
or
|
|
.SM NEWLINE\s0
|
|
characters.
|
|
.SH OPTIONS
|
|
.LP
|
|
When
|
|
.IR filename s
|
|
are specified on the command line,
|
|
their names will be printed along with the counts.
|
|
.LP
|
|
The default is
|
|
.B \-lwc
|
|
(count lines, words, and characters).
|
|
.TP
|
|
.B l
|
|
Count lines.
|
|
.TP
|
|
.B w
|
|
Count words.
|
|
.TP
|
|
.B c
|
|
Count characters.
|
|
.SH EXAMPLE
|
|
.RS
|
|
.nf
|
|
.ft B
|
|
example%
|
|
wc /usr/share/man/man1/{csh.1,sh.1,telnet.1}
|
|
.if t .ta +8nR +8nR +8nR +2n
|
|
.if n .ta 8R 16R 24R 26
|
|
1876 11223 65895 /usr/share/man/man1/csh.1
|
|
674 3310 20338 /usr/share/man/man1/sh.1
|
|
260 1110 6834 /usr/share/man/man1/telnet.1
|
|
2810 15643 93067 total
|
|
example%
|
|
.fi
|
|
.ft R
|
|
.RE
|
|
.SH ENVIRONMENT
|
|
.LP
|
|
The environment variables
|
|
.BR \s-1LC_CTYPE\s0 ,
|
|
.BR \s-1LANG\s0 ,
|
|
and
|
|
.B \s-1LC\s0_default
|
|
control the character classification
|
|
throughout
|
|
.BR wc .
|
|
On entry to
|
|
.BR wc ,
|
|
these environment variables are checked in the
|
|
following order:
|
|
.BR \s-1LC_CTYPE\s0 ,
|
|
.BR \s-1LANG\s0 ,
|
|
and
|
|
.BR \s-1LC\s0_default.
|
|
When a valid value is found,
|
|
remaining environment variables for character classification
|
|
are ignored.
|
|
For example, a new setting for
|
|
.B \s-1LANG\s0
|
|
does not override the current valid character
|
|
classification rules of
|
|
.BR \s-1LC_CTYPE\s0 .
|
|
When none of the values is valid,
|
|
the shell character
|
|
classification defaults to the
|
|
.SM POSIX.1 \*(lqC\*(rq
|
|
locale.
|