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
Grep and delete lines except the lines with strings vj8436 Shell Programming and Scripting 14 04-17-2009 12:25 PM
Shell script to remove duplicates lines in a file RichElks Shell Programming and Scripting 1 02-25-2009 11:05 PM
duplicates lines with one column different dhanamurthy Shell Programming and Scripting 10 05-07-2008 06:38 AM
How to delete first 5 lines and last five lines in all text files ragavendran31 Shell Programming and Scripting 10 02-21-2008 07:58 AM
delete blank lines or lines with spaces only vascobrito UNIX for Dummies Questions & Answers 3 01-13-2004 07:36 AM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-17-2009
necroman08 necroman08 is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 28
How to delete lines in a file that have duplicates or derive the lines that aper once

Input:

Code:
a
b
b
c
d
d

I need:

Code:
a
c

I know how to get this (the lines that have duplicates) :
b
d

Code:
sort file | uniq -d

But i need opossite of this. I have searched the forum and other places as well, but have found solution for everything except this variant of the problem.

Last edited by Yogesh Sawant; 07-17-2009 at 07:00 AM.. Reason: adde code tags
 

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 07:17 AM.


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