刪除包含某字串的整行 - Linux

Table of Contents

如果某行包含 apple
我希望能刪去那一整行(而非變空白)

應該是用sed吧
可是我查到的刪除 都只有指定行號

請問可以指定'包含字串'嗎?

--

All Comments

Ula avatarUla2011-08-20
inverse grep ?
grep -v
Faithe avatarFaithe2011-08-24
在vim裡 :g/apple/d
Annie avatarAnnie2011-08-28
sed '/apple/d' yourfile
Joe avatarJoe2011-08-31
謝謝