From ba2a835251f1027b7e8f81ac7fabbc9648a75fbc Mon Sep 17 00:00:00 2001 From: Abel Date: Thu, 14 Oct 2021 01:32:18 +0800 Subject: [PATCH] wc: split osx and common platform (#6834) --- pages/common/wc.md | 4 ++++ pages/osx/wc.md | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 pages/osx/wc.md diff --git a/pages/common/wc.md b/pages/common/wc.md index 6f29f3e534..797ba65541 100644 --- a/pages/common/wc.md +++ b/pages/common/wc.md @@ -22,3 +22,7 @@ - Use standard input to count lines, words and characters (bytes) in that order: `{{find .}} | wc` + +- Count the length of the longest line in number of characters: + +`wc --max-line-length {{file}}` diff --git a/pages/osx/wc.md b/pages/osx/wc.md new file mode 100644 index 0000000000..6f29f3e534 --- /dev/null +++ b/pages/osx/wc.md @@ -0,0 +1,24 @@ +# wc + +> Count lines, words, or bytes. +> More information: . + +- Count lines in file: + +`wc -l {{file}}` + +- Count words in file: + +`wc -w {{file}}` + +- Count characters (bytes) in file: + +`wc -c {{file}}` + +- Count characters in file (taking multi-byte character sets into account): + +`wc -m {{file}}` + +- Use standard input to count lines, words and characters (bytes) in that order: + +`{{find .}} | wc`