Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

WC(1)  —  USER COMMANDS

NAME

wc − display a count of lines, words and characters

SYNOPSIS

wc [ −lwc ] [ filename ... ]

DESCRIPTION

wc counts lines, words, and characters in filenames, or in the standard input if no filename appears.  It also keeps a total count for all named files.  A word is a string of characters delimited by SPACE, TAB, or NEWLINE characters. 

OPTIONS

When filenames are specified on the command line, their names will be printed along with the counts.

The default is −lwc (count lines, words, and characters). 

l Count lines. 

w Count words. 

c Count characters. 

EXAMPLE

example%
wc /usr/share/man/man1/{csh.1,sh.1,telnet.1}
18761122365895 /usr/share/man/man1/csh.1
674331020338 /usr/share/man/man1/sh.1
26011106834 /usr/share/man/man1/telnet.1
28101564393067 total
example%

ENVIRONMENT

The environment variables LC_CTYPE, LANG, and LC_default control the character classification throughout wc.  On entry to wc, these environment variables are checked in the following order: LC_CTYPE, LANG, and LC_default.  When a valid value is found, remaining environment variables for character classification are ignored.  For example, a new setting for LANG does not override the current valid character classification rules of LC_CTYPE.  When none of the values is valid, the shell character classification defaults to the POSIX.1 “C” locale. 

Sun Release 4.1  —  Last change: 2 October 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026