![]() |
|
|
|
|
|||||||
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to remove the lines from file using perl | dipakg | Shell Programming and Scripting | 5 | 06-03-2008 04:49 AM |
| remove blank lines in *.srt file :) | hungbp | UNIX for Dummies Questions & Answers | 10 | 02-16-2008 04:40 AM |
| remove lines from file | bluemoon1 | Shell Programming and Scripting | 9 | 11-08-2007 09:40 PM |
| Remove Similar Lines from a File | Nysif Steve | Shell Programming and Scripting | 3 | 09-04-2007 07:20 AM |
| remove extra lines in the file | CamTu | Shell Programming and Scripting | 8 | 03-29-2005 10:13 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
vi to remove lines in file
All,
I have a text file with several entries like below: personname personname.domain.com I know there is a way to use vi to remove only the personname.domain.com line. Can someone help? I believe that it involves /s/g/ something...I just can't remember the exact syntax. Thanks |
| Forum Sponsor | ||
|
|
|
|||
|
I got it:
:g/outdated/d This command tells vi to do a global search for "outdated" and to delete any line containing that text. :g/out dated/d This command tells vi to do a global search for "out dated" and to delete any line containing that text--including the space. |
|||
| Google UNIX.COM |
| Thread Tools | |
| Display Modes | |
|
|