I have a file like below

```
first line
second line
third line
forth line

```

I want to delete the lines after the second line but retain the second line. I have tried
`sed -i '/second line/,$d' filename` but it will delete the second line. How to modify it?