wc: refresh (#7391)

This commit is contained in:
marchersimon
2021-11-09 08:48:09 +01:00
committed by GitHub
parent 8d3b6b40cc
commit 69267420f7
2 changed files with 25 additions and 21 deletions

View File

@@ -1,28 +1,28 @@
# wc
> Count lines, words, or bytes.
> Count lines, words, and bytes.
> More information: <https://www.gnu.org/software/coreutils/wc>.
- Count lines in file:
- Count all lines in a file:
`wc -l {{file}}`
`wc --lines {{path/to/file}}`
- Count words in file:
- Count all words in a file:
`wc -w {{file}}`
`wc --words {{path/to/file}}`
- Count characters (bytes) in file:
- Count all bytes in a file:
`wc -c {{file}}`
`wc --bytes {{path/to/file}}`
- Count characters in file (taking multi-byte character sets into account):
- Count all characters in a file (taking multi-byte characters into account):
`wc -m {{file}}`
`wc --chars {{path/to/file}}`
- Use standard input to count lines, words and characters (bytes) in that order:
- 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 {{file}}`
`wc --max-line-length {{path/to/file}}`