LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-18-2004, 03:24 AM   #1
machinemen
LQ Newbie
 
Registered: Jun 2004
Posts: 2

Rep: Reputation: 0
text editing


Hey,
I need to remove duplicate lines from a list. Problem is that the first word may
be different, and second word is the one that matters.. like this:
word1 word2
word3 word2
But I can't figure out how to do this with "sort" and "uniq", any help appreciated.
 
Old 06-18-2004, 05:06 AM   #2
jkobrien
Member
 
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507

Rep: Reputation: 30
Try "sort -uk2,2 <FILENAME>".

John
 
Old 06-18-2004, 05:38 AM   #3
machinemen
LQ Newbie
 
Registered: Jun 2004
Posts: 2

Original Poster
Rep: Reputation: 0
That worked. Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
text editing from a script vogelbaugh Linux - General 2 09-22-2005 01:53 PM
Editing text Files kool_kid Linux - Newbie 12 12-27-2004 12:21 AM
editing text files killertofu Linux - Newbie 2 10-15-2004 06:55 PM
Suggestions for text editing jackpotrobot Linux - Software 2 07-06-2004 05:08 PM
Text editing PhuckFonix Linux - Newbie 5 05-22-2004 10:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration