The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
18 views

Sort piped to uniq unexpected output

I have a file that looks like this: "string",192.168.1.0,,TX,192.168.1.2,,,100,0,0,10,10,10,, "string",192.168.1.0,,TX,192.168.1.1,,,100,0,0,10,10,10,, ...
0
votes
3answers
101 views

remove lines with duplicate words

I have a sorted file with lines like this word1 abca word1 abcb word1 abcc word2 abca word2 abcb word3 abbb ........... and i want to have something like this word1 abca word2 abca word3 ...
0
votes
1answer
37 views

How to print statistics from lines in a file

I often find myself computing percentages manually after filtering through a log file to find the proportion of X or Y in it. Can this easily be achieved via common CLI tools?
0
votes
1answer
176 views

Counting duplicates lines from a stream

I'm currently parsing apache logs with that command: tail -f /opt/apache/logs/access/gvh-access_log.1365638400 | grep specific.stuff. | awk '{print $12}' | cut -d/ -f3 > ~/logs The output is a ...
6
votes
3answers
327 views

Remove duplicates in each line of a file

How can I remove duplicates in each line, for example here? 1 1 1 2 1 2 3 5 5 4 1 2 3 3 I'd like to get this output: 1 2 3 5 4 1 2 3 There are lots of lines (100,000) and in each line I want ...
0
votes
2answers
958 views

linux sort -n uniq -c

I have a text file which contains about 50MB of text: valA valB valC valZ valB Whats the quickest way to: cat the file Display the unique appearences
0
votes
1answer
84 views

gnu `uniq -c`: display counts graphically as bars

With sort $file | uniq -c, it's possible to sum up files/input and show the number occurences like that: 13 foo 1 bar To get a better grasp of this data, I'd like to see them graphically ...
1
vote
1answer
202 views

gnu sort/uniq: sorting by number of times

How can I use GNU sort and uniq to have the most common occurrences on top instead of numerical or alphanumerical sorting? Example list.txt: 1 2 2 2 3 3 Since '2' occurs 3 times, should be on top, ...
0
votes
2answers
130 views

lines identical except for their first word, put the first word in a variable

I have file(sudoers) in which lines can be identical except for the first word in them (different users can execute the same set of commands). I am able to extract such a line using the command: # ...
0
votes
1answer
249 views

option -f for linux command

this is the content of test file: this this this that is that a that MAP that map that when I do uniq testCase -f1, the result is: this this this that which is reasonable, but ...