How to delete lines upto a particular line

research1695

New Member
Joined
Aug 22, 2020
Messages
13
Reaction score
6
Credits
108
Hello Linux users,

I want help with command line for the following purpose,

From a file, I want to delete line 1 to line x, where line x contains a specific phrase;

Phrase:[ hbonds_Protein ]
Filename: hbond.txt
In the attached file, this phrase is on line 37, in this case I want to delete lines 1 to 37.

Based on google search, I tried the following command, but it did not work.

sed '1,/[ hbonds_Protein ]/d' hbond.txt

Any insight would be appreciated,
Many thanks,
Neena
 

Attachments

  • hbond.txt
    2.7 KB · Views: 205



Members online


Top