Leif160519的blog Leif160519的blog

——————

目录
Linux wc命令:统计指定文件中的字节数、字数、行数
/      

Linux wc命令:统计指定文件中的字节数、字数、行数

格式命令如下:

wc [选项] 文件名

选项:

  • -l:只统计行数;
  • -w:只统计单词数;
  • -m:只统计字符数;

用这个命令统计一下 /etc/passwd 文件中到底有多少行、多外单词、多少个字符,命令如下:

wc /etc/passwd
  29   46 1402 /etc/passwd

用 wc 命令统计服务器上有多少个正常连接:

netstat -an | grep ESTABLISHED | wc -l
48

参考:


“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题Linux wc命令:统计指定文件中的字节数、字数、行数
作  者Leif160519
出  处https://github.icu/articles/2020/04/20/1587366103759.html
关于博主:坐标南京,运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!