utility
wc
Count newlines, bytes, characters or words respectively. Locale affects character and word interpretation.
Formal Syntax & Structure
bash syntaxbash
wc [-l|-c|-m|-w] [FILE ...]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| FILE | path | Input file or stdin. |
| -l | option | Count newline bytes. |
Return Value
exit status
Exit status 0 on success; nonzero indicates failure or a command-specific condition. See description and example.
Working Example
Example Snippetbash
printf 'a\nb' > records.txtwc -l < records.txtwc -c < records.txt