所以,基本上
此行将被删除
和
(此行也将被删除)
但
事实上,这条线不会
答案1
有好几种方法。消极思考:
sed '/[a-z]/!d' # !x runs x if the pattern doesn't match
grep -v '[a-z]' # -v means print if the regexp doesn't match
awk '!/[a-z]/' # !expr negates expr
答案2
尝试这个:
sed '/[a-z]/!d' file