5

How to print only the duplicate values from a text file?

view full story
linux-howto

http://unix.stackexchange.com – Suppose there is a column of numeric values like following: File1: 1 2 3 3 3 4 4 4 5 6 I want the output: 3 4 That is, only the repeated lines. Is there any command line tools to find this out in Linux? (NB: The values are numerically sorted). (HowTos)