linux 用grep匹配横线

file的内容如下:
ADSFADSFSDFASDFJKJK
----------------------------------------
ADSFADSFSDFASDFJKJK
----------------------------------------
ADSFADSFSDFASDFJKJK


linux 用grep匹配第2行和第4行横短线:
grep "^-*$" file
linux 用grep匹配不含横短线的行:
grep -v "^-*$" file
【推广】 免费学中医,健康全家人
原文地址:https://www.cnblogs.com/emanlee/p/3308167.html