linux下查找文件中空行的行号

时间:2020-12-07 12:22:19   收藏:0   阅读:9

linux下查找文件中空行的行号

linux下查找文件中空行的行号

以aa.txt举例:

方法1:sed -n ‘/[a-zA-Z0-9@#$%^&*]/!=‘ aa.txt
方法2:grep -n ^$ aa.txt
方法3:awk ‘/^$/{print NR}‘ aa.txt
方法4:sed -n ‘/^$/=‘ aa.txt

https://www.cnblogs.com/stono/p/11578093.html

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!