打印每個 FILE 的換行符 單詞 字節計數,及總行數 (若指定多個 FILE)。
單詞是由空格分隔的非零長字符序列。
curl -I -m 5 -s -w "%{http_code}\n" -o /dev/null www.baidu.com | egrep "30[12]|200" | wc -l
基本語法
wc [OPTION]... [FILE]... wc [OPTION]... --files0-from=F
沒有 FILE 或 FILE 為 - 時,讀取標準輸入。
展示計數信息順序:換行符 單詞 字符 字節 最大行長度。
OPTION 選項
| 參數 | EN 解釋 | 中文翻譯 | 備注 |
|---|---|---|---|
| -c, --bytes | print the byte counts | 打印字節計數 | |
| -m, --chars | print the character counts | 打印字符計數 | |
| -l, --lines | print the newline counts | 打印換行符計數 | |
| --files0-from=F |
read input from the files specified by NUL-terminated names in file F; If F is - then read names from standard input |
從文件 F 中以 NUL 終止的名稱指定的文件中讀取輸入; 若 F 為 - 則從標準輸入讀取名稱 |
|
| -L, --max-line-length | print the maximum display width | 打印最大顯示寬度 | |
| -w, --words | print the word counts | 打印單詞計數 | |
| --help | display this help and exit | 顯示幫助並退齣 | |
| --version | output version information and exit | 輸齣版本信息並退齣 |
| 功能 | 命令 | 文字解釋 | 示例 | 示例解釋 |
|---|---|---|---|---|
| 幫助 | wc --help | 展示幫助信息 | ||
| 版本 | wc --version | 展示版本信息 |
版權聲明: 本文為獨傢原創稿件,版權歸 樂數軟件 ,未經許可不得轉載。