Remove all lines except matching pattern line best practice (sed)

前端 未结 4 2007
臣服心动
臣服心动 2021-01-03 21:43

I want to remove all lines except the line(s) containing matching pattern.

This is how I did it:

sed -n \'s/matchingpattern/matchingpattern/p\' file.         


        
4条回答
提交回复
热议问题