wc命令

重要参数

-l 统计多少行
-w 统计多少个单词,依据空格或换行符来区别
-m 统计多少字符,换行符空格及一切看不见的字符都算一个,wc命令会默认添加一个换行符

示例

[root@hecs-98663 myshell]# cat text 
hello world
ni hao
[root@hecs-98663 myshell]# wc -l text 
2 text
[root@hecs-98663 myshell]# wc -w text 
4 text
[root@hecs-98663 myshell]# wc -m text 
19 text

posted @ 2023-11-27 15:35  Bre-eZe  阅读(15)  评论(0)    收藏  举报