I want to print 1 version of Duplicates and remove unique lines in bash linux -


the input follows:

mark john marry mark john 

and output should be:

mark john 

how in bash file linux.

sort | uniq -d 

for example:

$ cat file mark john marry mark john   $ cat file | sort | uniq -d john mark 

to preserve order, can use more obscure awk command:

$ awk 'a[$0]++ == 1' file mark john 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -