Solved

Shell Script

Posted on 2004-10-10
2
184 Views
Last Modified: 2010-04-15
I used uniq -c to list the number of occurrences of each line from a text file.

I see the numbers outputted but what I want is only the lines with 1 occurrence.

How do I pull just these lines out?

Thank you.
0
Comment
Question by:siggyjav
  • 2
2 Comments
 
LVL 23

Accepted Solution

by:
brettmjohnson earned 500 total points
ID: 12273643
uniq -c | awk '{if ($1 == 1) print $0}'
0
 
LVL 23

Expert Comment

by:brettmjohnson
ID: 12273666
More obviously, why not use uniq -u ?

     -u      Don't output lines that are repeated in the input.

0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mixing C++ and C code elegantly 10 156
Problem to ASCII 1 176
Problem to save 10 164
How to build c program using make in mingw environment? 9 61
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question