1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 17:02:09 +02:00
tldr/pages/common/wc.md
K.B.Dharun Krishna 898f711019
pages/*: update GNU coreutils links, sync translation pages (#15543)
Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2025-01-18 18:45:33 +05:30

605 B

wc

Count lines, words, and bytes. More information: https://www.gnu.org/software/coreutils/manual/html_node/wc-invocation.html.

  • Count all lines in a file:

wc --lines {{path/to/file}}

  • Count all words in a file:

wc --words {{path/to/file}}

  • Count all bytes in a file:

wc --bytes {{path/to/file}}

  • Count all characters in a file (taking multi-byte characters into account):

wc --chars {{path/to/file}}

  • Count all lines, words and bytes from stdin:

{{find .}} | wc

  • Count the length of the longest line in number of characters:

wc --max-line-length {{path/to/file}}