Count lines, words, and bytes统计行数、单词数和字节数
wc stands for "word count". It prints newline, word, and byte counts for each file. It's essential for quickly assessing file sizes, counting lines of code, or analyzing text data.
wc代表"word count"(字数统计)。它打印每个文件的换行符、字数和字节计数。对于快速评估文件大小、统计代码行数或分析文本数据至关重要。
| Option选项 | Full Name完整名称 | Description描述 | Example示例 |
|---|---|---|---|
-l |
lines行数 | Count newline characters计算换行符数量 | wc -l file.txt |
-w |
words字数 | Count words计算字数 | wc -w file.txt |
-c |
bytes字节 | Count bytes计算字节数 | wc -c file.txt |
-m |
chars字符 | Count characters计算字符数 | wc -m file.txt |
-L |
max-line-length最大行长度 | Display length of longest line显示最长行的长度 | wc -L file.txt |
📊 "wc" = Word Count - Count words and more!
📊 "wc" = Word Count(字数统计) - 统计字数等!
📏 -l = Lines - Count lines (newlines)
📏 -l = Lines(行) - 计算行数(换行符)
📝 -w = Words - Count words (whitespace-separated)
📝 -w = Words(字) - 计算字数(空白符分隔)
🦠 -c = Characters/bytes - Count bytes
🦠 -c = Characters/bytes(字符/字节) - 计算字节数