LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-11-2009, 04:38 AM   #1
sumitdevbharadwaj
LQ Newbie
 
Registered: Nov 2008
Posts: 20

Rep: Reputation: 0
Thumbs up Redundant entries in a file.


Hi All,

How can I remove redundant entries in a file.
eg.
$ cat test
ABC
ABC
123
123
ABC
DEF
GHI
DEF

I want to remove all the extra entries and make it look like:
ABC
123
DEF
GHI

Can anybody help?
Thanks in advance

Regards
Sumit Dev Bharadwaj
 
Old 09-11-2009, 04:44 AM   #2
JulianTosh
Member
 
Registered: Sep 2007
Location: Las Vegas, NV
Distribution: Fedora / CentOS
Posts: 674
Blog Entries: 3

Rep: Reputation: 90
cat test | sort -u
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
where are the /etc/fstab file entries? nkd Linux - Desktop 7 04-16-2008 03:16 AM
Replicate file shares for redundant servers? toben Linux - Software 1 12-06-2007 07:48 AM
Not able to see connection entries in ip_conntrack file!! vishamr2000 Linux - Security 9 05-14-2007 12:08 AM
Entries in hosts.deny file tensigh Linux - Security 8 05-02-2006 04:52 PM
fstab file entries what do they mean? bgagnon SUSE / openSUSE 2 11-12-2004 02:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:21 PM.

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
Open Source Consulting | Domain Registration