z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Counting lines, words, and bytes in a file

z/OS UNIX System Services User's Guide
SA23-2279-00

The wc command tells you how big a text document is.
wc file file ...
tells you the number of lines, words, and bytes in each file.
If you want to find out how many files are in a directory, enter:
ls | wc
This pipes the output of ls through wc. Because ls prints one name per line when its output is being piped or redirected, the number of lines is the number of files and directories under your working directory.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014