LinuxQuestions.org
Visit Jeremy's Blog.
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 11-29-2010, 01:22 PM   #1
makeTaller
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, 01:27 PM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Arch
Posts: 3,059

Rep: Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266
uniq only recognizes duplicates that are consecutive, so you have to sort first
Code:
sort network.passwd.txt | uniq -d
 
1 members found this post helpful.
Old 11-29-2010, 01:31 PM   #3
makeTaller
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, 01:48 PM   #4
MTK358
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.
 
  


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


All times are GMT -5. The time now is 07:09 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