Wc utility
The wc utility is a Unix command-line tool that reports counts of lines, words, bytes, characters, and related properties in files or input streams.
The Quick Python Book, Fourth Edition
The wc utility is a Unix command-line tool that counts lines, words, and bytes in files or input streams and can report the maximum line length.
- How it is used
- Uses wc as the behavioral target for refactoring a Python command-line counting program.
- How deep it goes
- Explains option selection and longest-line tracking, while leaving separate byte and character handling as an additional challenge.
- Examples
- Uses a Python counting program, wc --help, and comparisons against the system wc command.
- What you can do after
- Builds a simplified counting program from scratch and compares its behavior with system wc.
Read how The Quick Python Book, Fourth Edition explains wc utility →
Tiny Python Projects: Learn coding and testing with puzzles and games
wc is a Unix command-line utility that reports counts of bytes, characters, lines, and words in files or standard input.
- How it is used
- Counts text from files or command pipelines to support quick command-line inspection.
- How deep it goes
- Explains counters, line iteration, splitting, formatting, and flags, but treats punctuation-aware word detection as later work.
- Examples
- Demonstrates fox.txt, multiple files, grep output, redirection, and a Python reimplementation named wc.py.
- What you can do after
- Build it from scratch in Python with file, STDIN, counting, formatting, and option-handling support.
Read how Tiny Python Projects: Learn coding and testing with puzzles and games explains wc utility →
Also covered in
What to know first
- plain textPlain text is character data represented without rich formatting, styling, or presentation instructions.
- bytesBytes are an ordered sequence of byte values, typically eight-bit units, used to represent binary data.
- standard inputStandard input is a process’s conventional input stream for reading data supplied by its environment, such as a terminal, file, or another process.
Related concepts
- file descriptormeasures · A file descriptor is an operating-system identifier for an open file, socket, pipe, or other input-output resource.
- input/output redirectionuses · Input/output redirection is a shell technique that changes where a command reads input or sends output, routing its streams to files or other destinations.
- character countmeasures · A character count is the number of characters in text or a file, including whitespace unless explicitly excluded.
- plain textuses · Plain text is character data represented without rich formatting, styling, or presentation instructions.
- command-line argumentconfigured by · A command-line argument is a value or option supplied to a program when it is invoked, providing input or affecting its behavior.
Questions about wc utility
What is wc utility?
The wc utility is a Unix command-line tool that reports counts of lines, words, bytes, characters, and related properties in files or input streams.
Which Manning books explain wc utility?
The Quick Python Book, Fourth Edition and Tiny Python Projects: Learn coding and testing with puzzles and games.
What should I know before learning wc utility?
Manning books that teach wc utility usually introduce plain text, bytes and standard input first.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

