[Solved] Bash: Remove all occurring pattern except 1


With no sample input, I will just guess and maybe it will help:

 cat file

header for file
1111
header for file
1111
2222
header for file
3333
4444
5555

awk '/header/&&c++>0 {next} 1' file

header for file
1111
1111
2222
3333
4444
5555

Though I am not the greatest in sed

sed '1!{/^header/d;}' file    

2

solved Bash: Remove all occurring pattern except 1