您可以使用两个地址的形式:
sed '0,/tat/{/tat/d;}' inputfile这将删除该模式的第一次出现。
引用自
info sed:
A line number of `0' can be used in an address specification like `0,/REGEXP/' so that `sed' will try to match REGEXP in the first input line too. In other words, `0,/REGEXP/' is similar to `1,/REGEXP/', except that if ADDR2 matches the very first line of input the `0,/REGEXP/' form will consider it to end the range, whereas the `1,/REGEXP/' form will match the beginning of its range and hence make the range span up to the _second_ occurrence of the regular expression.



