sed -e '1!b' -e '/GH/!d' file
Linux SED script find the 1st line that match pattern and delete itlinux
echo -e "AB\nMN2\nMN3" | sed "0,/N/{//d;}"
How to conditionally remove first line only with sed when it matches?bash
sed命令.net