LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 12: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, 12:27 PM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,781

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
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, 12: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, 12:48 PM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

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


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 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 LinuxQuestions.org 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

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

All times are GMT -5. The time now is 07:51 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
Open Source Consulting | Domain Registration