删除空行
sed '/^$/d' dummy.txt
删除包含关键词的行
sed '/the/d' dummy.txt
删除包含多个关键词的行
sed '/brown\|the/d' dummy.txt
删除某一开头字符的行
sed '/^[[:digit:]]/d' dummy.txt
sed '/^[tb]/d' dummy.txt
sed '/^[[:upper:]]/d' dummy.txt
删除某一结尾字符的行
sed '/e$/d' dummy.txt
参考:
https://linuxhint.com/sed-command-to-delete-a-line/