Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Shell Script

Posted on 2004-10-10
2
Medium Priority
?
192 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Suggested Courses

824 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