Skip to main content
added 6 characters in body
Source Link
cuonglm
  • 158.2k
  • 41
  • 342
  • 420

I have a sorted wordlistwords list, line by line file like so..

apple

apple

grapes

lime

orange

orange

pear

pear

peach

strawberry

strawberry:

...................

apple
apple
grapes
lime
orange
orange
pear
pear
peach
strawberry
strawberry

I only want to print out unique lines and drop duplicates.

grapes

peach:

lime

grapes
peach
lime

How do ican I do this with sedsed, awkawk or perl perl?

Thanks

I have a sorted wordlist, line by line file like so..

apple

apple

grapes

lime

orange

orange

pear

pear

peach

strawberry

strawberry

...................

I only want to print out unique lines and drop duplicates.

grapes

peach

lime

How do i do this with sed, awk or perl ?

Thanks

I have a sorted words list, line by line file like so:

apple
apple
grapes
lime
orange
orange
pear
pear
peach
strawberry
strawberry

I only want to print out unique lines and drop duplicates:

grapes
peach
lime

How can I do this with sed, awk or perl?

Source Link
user155704
user155704

Print only unique lines from file not the duplicates

I have a sorted wordlist, line by line file like so..

apple

apple

grapes

lime

orange

orange

pear

pear

peach

strawberry

strawberry

...................

I only want to print out unique lines and drop duplicates.

grapes

peach

lime

How do i do this with sed, awk or perl ?

Thanks