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

Eden avatar
By Eden
at 2011-08-15T12:29

Table of Contents

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

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

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

--
Tags: Linux

All Comments

Ula avatar
By Ula
at 2011-08-20T11:10
inverse grep ?
grep -v
Faithe avatar
By Faithe
at 2011-08-24T12:10
在vim裡 :g/apple/d
Annie avatar
By Annie
at 2011-08-28T19:45
sed '/apple/d' yourfile
Joe avatar
By Joe
at 2011-08-31T02:00
謝謝

用cclive下載youtube

Emma avatar
By Emma
at 2011-08-14T17:51
跟據我man到的方法 最簡單的就是$cclive and#34;網址and#34; 然後我輸入 cclive and#34;http://www.youtube.com/watch?v=2X1nP8RJmvAandamp;feature=feedrec_grec_indexand#34; 結果得到以下 ...

請問set UID的問題???

Emma avatar
By Emma
at 2011-08-14T01:03
我不知道我觀念對不對 我目前寫一個printid.c檔 裡面是print執行者的effective uid 用geteuid()這個方法顯示 那我現在把這個檔設setuid setuid的用意不是代表 執行時使用者暫時取的root權限 所以照理說 我用一般帳號執行printid時  effect uid應該 ...

在xp系統下再灌linux,grub進不了xp?

Poppy avatar
By Poppy
at 2011-08-13T22:37
再次打擾大家... 我打了fdsk -l /dev/sd? 後跑出來的訊息是 所用裝置 開機 開始 結束 區塊 識別號 系統 /dev/sda1 16065 89241074 44612505 f W95 Extand#39;d ...

ATI 9200 顯卡driver問題 ??

Annie avatar
By Annie
at 2011-08-13T15:03
我是使用ubuntu 10.04.2的新手 搞了一個早上,還是沒有將ATi顯卡的 driver 搞定 使用lspci 得到底下 01:00.0 VGA compatible controller: ATI Technologies Inc RV280 [Radeon 9200] (rev 01) 也在 ...

UEFI PXE Server架設 (RHEL6)

Hedy avatar
By Hedy
at 2011-08-13T08:52
最近研究完UEFI PXE Server架設 這邊與各位分享 以下是用Shell Script寫法 附上說明 #!/bin/bash # 這個Shell Script適用在RHEL6來架設UEFI PXE Server # 網路IP請先設定好 這邊使用的是192.168.100.100當範例 # ...