Remove all lines after a pattern match in shell using sed command

by rajesh 2014-05-13 11:52:49

Using the following command will remove all the lines in file after a defined pattern match:
 sed -e '/pattern/,$d' 
filename replace pattern with your pattern and finame with your file name.
1227
like
0
dislike
0
mail
flag

You must LOGIN to add comments