Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-29-2010, 12:22 PM   #1
LQ Newbie
Registered: Nov 2010
Distribution: LUCID
Posts: 6

Rep: Reputation: 0
I'm having uniq problems... no pun intended

Hi, i concatenated two separate files (client.passwd.txt & server.passwd.txt) into a file called (network.passwd.txt) and ran the follow commands on the file:

$ cat client.passwd.txt server.passwd.txt > network.passwd.txt

$ uniq -d network.passwd.txt

I want to find duplicate entries on this file but it gives nothing to stdout. ???

$ sort network.passwd.txt

Sort shows that there are duplicates in the file.... soo ??

I've even tested the uniq command on a separate concatenated file called listings.txt and it showed the duplicates...

regards makeTaller
Old 11-29-2010, 12:27 PM   #2
Senior Member
Registered: Nov 2005
Distribution: Arch
Posts: 3,131

Rep: Reputation: 1317Reputation: 1317Reputation: 1317Reputation: 1317Reputation: 1317Reputation: 1317Reputation: 1317Reputation: 1317Reputation: 1317Reputation: 1317
uniq only recognizes duplicates that are consecutive, so you have to sort first
sort network.passwd.txt | uniq -d
1 members found this post helpful.
Old 11-29-2010, 12:31 PM   #3
LQ Newbie
Registered: Nov 2010
Distribution: LUCID
Posts: 6

Original Poster
Rep: Reputation: 0
oh! thanks! It works now i can go into the next chapter of this book confident thanks again...
Old 11-29-2010, 12:48 PM   #4
LQ 5k Club
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
Mark the thread as solved.


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
a pun newbiesforever General 3 02-20-2009 07:41 AM
Gnu Linux User saying Hello... pardon the pun skelter42 Member Intro 2 01-26-2008 01:08 PM
Which distro to pun on this computer? junglemike Linux - Distributions 2 03-21-2007 09:10 PM
Linux is COMPLETELY ROOTED (no pun intended) split_banana Linux - General 6 08-17-2003 01:59 PM
uniq Cyth Linux - General 2 02-19-2003 09:29 AM

All times are GMT -5. The time now is 12:11 PM.

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