| Vi Search and Delete Lines |
|
|
|
| How To - Vi |
| Written by Christian Foronda |
| Wednesday, 01 September 2010 08:58 |
|
"[ESC]" is the "Escape" key. Deletes all lines containing the word "junk": [ESC]:%g/junk/d
Deletes all lines containing apples, oranges or grapes: [ESC]:% ! egrep -v "(apples|oranges|grapes)"
Search and delete lines 50 through 100: [ESC]:50,100/junk/d
Remove DOS ^M from ends of lines: [ESC]:%s/<Ctrl-V><Ctrl-M>//g Similar articles
|
| Last Updated on Tuesday, 18 January 2011 09:13 |


