1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/wc.md

29 lines
650 B
Markdown
Raw Normal View History

2013-12-25 22:17:18 +11:00
# wc
2021-11-09 08:48:09 +01:00
> Count lines, words, and bytes.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/wc-invocation.html>.
2013-12-25 22:17:18 +11:00
2021-11-09 08:48:09 +01:00
- Count all lines in a file:
2013-12-25 22:17:18 +11:00
`wc {{[-l|--lines]}} {{path/to/file}}`
2013-12-25 22:17:18 +11:00
2021-11-09 08:48:09 +01:00
- Count all words in a file:
`wc {{[-w|--words]}} {{path/to/file}}`
2021-11-09 08:48:09 +01:00
- Count all bytes in a file:
2013-12-25 22:17:18 +11:00
`wc {{[-c|--bytes]}} {{path/to/file}}`
2013-12-25 22:17:18 +11:00
2021-11-09 08:48:09 +01:00
- Count all characters in a file (taking multi-byte characters into account):
2013-12-25 22:17:18 +11:00
`wc {{[-m|--chars]}} {{path/to/file}}`
2021-11-09 08:48:09 +01:00
- Count all lines, words and bytes from `stdin`:
`{{find .}} | wc`
- Count the length of the longest line in number of characters:
`wc {{[-L|--max-line-length]}} {{path/to/file}}`