linux - egrep : find lines with no characters

标签 linux unix grep

我有一个文本文件,我需要搜索该文件并计算文件中有多少空行。空行是没有字符的行。

我必须使用 egrep。

最佳答案

[aman@localhost ~]$ cat >试试

    sldjjsd


    dkfjkjdf


    dfkjdf

[aman@localhost ~]$ egrep '^$' try|wc -l

4

关于linux - egrep : find lines with no characters,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9048269/

相关文章:

linux - 在一行代码中使用 basename 替换扩展名

bash - 循环(?)一个 if 语句

linux - 使用 ls 查找文件名模式

regex - grep regex忽略行尾的注释

regex - 为什么这个正则表达式不能与 grep 一起使用?

c - 任何可用于将 c99 样式注释//转换为 c 样式注释/* ..*/到整个项目的工具/脚本?

linux - 如何始终连接到 Linux 上的同一个 rfcomm 端口?

bash - UNIX:如何以文件作为输入来运行程序

for-loop - 如何使用 awk 和 grep 计算两个文件的平均值

c - 如何在 Windows 上设置 C 环境(也可能与 Linux 兼容)