commands
wc — count newlines, words, bytes or characters
-l counts newline bytes, -w words, -c bytes, -m characters in the active locale. With stdin, no filename is appended to the count. Example assumes a fresh text-streams lab fixture.
Formal Syntax & Structure
linux syntaxlinux
wc [OPTION]... [FILE]...Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -l | option | Newlines |
| -w | option | Words |
| -c | option | Bytes |
| -m | option | Characters |
| FILE | operand | Input file |
Return Value
exit status and output
GNU wc prints requested counts and returns nonzero on read/write errors. A zero count is valid output, not failure; line counts count newline bytes.
Working Example
Example Snippetlinux
wc -l < events.txt