![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Remove Similar Lines from a File | Nysif Steve | Shell Programming and Scripting | 4 | 03-13-2009 03:49 AM |
| How to remove the lines from file using perl | dipakg | Shell Programming and Scripting | 5 | 06-03-2008 07:49 AM |
| remove blank lines in *.srt file :) | hungbp | UNIX for Dummies Questions & Answers | 10 | 02-16-2008 08:40 AM |
| remove lines from file | bluemoon1 | Shell Programming and Scripting | 9 | 11-09-2007 01:40 AM |
| remove extra lines in the file | CamTu | Shell Programming and Scripting | 8 | 03-29-2005 01:13 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | 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 |
|
||||
|
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. |
![]() |
| Bookmarks |
| Tags |
| vim |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|