Suppose there is a column of numeric values like following:
1 2 3 3 3 4 4 4 5 6
I want the output:
That is, only the repeated lines. Is there any command line tools to find this out in Linux? (NB: The values are numerically sorted).
You can use
This will print out the duplicates only. The input file needs to be sorted such that all duplicates are consecutive (which they appear to be), so run it through sort first if it is not.
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?