I want to delete a line which matches the word name
but doesn't delete the lines have something following it. I can't seem to find an answer to this. I know sed -i '/name/d' *
would delete the whole line matching the word name
but this is not what I want.
An example will clarify my question.
If input is -
name xav
name lmn
name
name abc
Then the output should be -
name xav
name lmn
name abc
basically the line with name
and nothing else should be deleted. The rest need to stay.