Linux系统中的wc(Word Count)命令的功能为统计指定文件中的行数、字数、字节数,并将统计结果显示输出。
1.命令格式:
wc [选项]文件…
2.命令功能:
统计指定文件中的行数、字数、字节数,并将统计结果显示输出。该命令统计指定文件中的行数、字数、字节数。如果没有给出文件名,则从标准输入读取。wc同时也给出所指定文件的总统计数。
3.命令参数:
-c 统计字节数。
-l 统计行数。
-m 统计字符数。这个标志不能与 -c 标志一起使用。
-w 统计字数。一个字被定义为由空白、跳格或换行字符分隔的字符串。
-L 打印最长行的长度。
--help
显示帮助信息
--version
显示版本信息
建议用--help
查看使用说明:
万一能看懂呢??
Usage: wc [OPTION]... [FILE]...
or: wc [OPTION]... --files0-from=F
Print newline, word, and byte counts for each FILE, and a total line if
more than one FILE is specified. With no FILE, or when FILE is -,
read standard input. A word is a non-zero-length sequence of characters
delimited by white space.
The options below may be used to select which counts are printed, always in
the following order: newline, word, character, byte, maximum line length.
-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
-L, --max-line-length print the length of the longest line
-w, --words print the word counts
--help display this help and exit
--version output version information and exit
GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report wc translation bugs to <http://translationproject.org/team/>
For complete documentation, run: info coreutils 'wc invocation'
单词:
Usage:用法