Ubuntu wc 命令详解


打印每个 FILE 的换行符 单词 字节计数,及总行数 (若指定多个 FILE)。

单词是由空格分隔的非零长字符序列。

另请参阅: cat     wc 主页

基本用法     详细用法

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 展示版本信息

 

版权声明: 本文为独家原创稿件,版权归 乐数软件 ,未经许可不得转载。