i have a file, say , abc.log
which contains data like,
123_1
123_2
123_3
123_4
123_5
123_6
123_7
123_8
123_9
123_3
123_5
123_3
123_7
123_6
123_1
123_3
As we can see, there are 16 rows. Now i need to grep for a pattern like '123_*' but want to have only unique rows, not the duplicate ones.
For e.g. grep '123_*' abc.log, will give allthe 16 rows
instead i want only 9 rows, which are unique and avoid all the duplicate rows.
How can i achieve this? please help