The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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 text dejavu88 Shell Programming and Scripting 7 06-08-2008 05:37 PM
duplicate line in a text file nixguy Shell Programming and Scripting 5 04-29-2008 03:19 AM
Duplicate records from oracle to text file. shilendrajadon UNIX for Advanced & Expert Users 1 01-10-2008 11:21 AM
Eleminating output to console pflink UNIX for Dummies Questions & Answers 3 02-27-2007 02:37 AM
grep multiple text files in folder into 1 text file? coppertone UNIX for Dummies Questions & Answers 7 08-23-2002 03:50 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-24-2008
coolkid coolkid is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 69
Eleminating Duplicate IPs from a text file

Hey Guys
I need to eleminate duplicate IP's from a text file using bash.Any suggestions.Appreciate your help guys.

--CoolKid
  #2 (permalink)  
Old 01-24-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922
Lightbulb

Try sort -u
  #3 (permalink)  
Old 01-24-2008
coolkid coolkid is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 69
Tried it..It is not working
  #4 (permalink)  
Old 01-24-2008
varungupta varungupta is offline
Registered User
  
 

Join Date: Feb 2007
Location: Pune, Dehradun (INDIA), Michigan(US)
Posts: 206
Quote:
Originally Posted by coolkid View Post
Hey Guys
I need to eleminate duplicate IP's from a text file using bash.Any suggestions.Appreciate your help guys.

--CoolKid
Hey,

uniq
This filter removes duplicate lines from a sorted file. It is often seen in a pipe coupled with sort.
cat list−1 list−2 list−3 | sort | uniq > final.list
# Concatenates the list files,
# sorts them,
# removes duplicate lines,
# and finally writes the result to an output file.

Try this logic, hope you'll get the desired one.

Thanks
Varun.
  #5 (permalink)  
Old 01-24-2008
coolkid coolkid is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 69
Thanks for the help folks.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:31 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0