Loading

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

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
 

 

posted @ 2019-09-24 14:23  stono  阅读(3735)  评论(0编辑  收藏  举报