sed指令进阶操作
删除
删除不匹配的第一行
sed -e '1!b' -e '/GH/!d' file
Linux SED script find the 1st line that match pattern and delete it
删除第一次匹配的行
echo -e "AB\nMN2\nMN3" | sed "0,/N/{//d;}"
How to conditionally remove first line only with sed when it matches?