![]() |
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 |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Remove duplicate lines in log files | karthikn7974 | Shell Programming and Scripting | 4 | 03-21-2009 06:41 PM |
| Remove Duplicate lines from File | Nysif Steve | UNIX for Dummies Questions & Answers | 18 | 09-09-2007 08:57 AM |
| Remove duplicate | sabercats | Shell Programming and Scripting | 2 | 03-31-2006 12:35 PM |
| Remove duplicate ??? | sabercats | Shell Programming and Scripting | 3 | 03-10-2006 07:06 PM |
| Remove Duplicate Lines in File | Teh Tiack Ein | Shell Programming and Scripting | 5 | 01-12-2006 08:30 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
how to remove duplicate lines
I have following file content (3 fields each line):
23 888 10.0.0.1 dfh 787 10.0.0.2 dssf dgfas 10.0.0.3 dsgas dg 10.0.0.4 df dasa 10.0.0.5 df dag 10.0.0.5 dfd dfdas 10.0.0.5 dfd dfd 10.0.0.6 daf nfd 10.0.0.6 ... as can be seen, that the third field is ip address and sorted. but there is duplilcate ip addresses. I want to kill line 6,7 and 9, so the new file will be 23 888 10.0.0.1 dfh 787 10.0.0.2 dssf dgfas 10.0.0.3 dsgas dg 10.0.0.4 df dasa 10.0.0.5 dfd dfd 10.0.0.6 ... please tell me how to do this, thanks! |