您的位置:首页 > 博客中心 > 网络系统 >

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

时间:2022-04-03 16:19

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

本类排行

今日推荐

热门手游