unix - remove first line if there is a duplicate -


i know how remove duplicate lines using sort , uniq there way remove first line duplicate not second?

for example, if have file following lines in it:

aaaaaaa bbbbbbb bbbbbbb ccccccc aaaaaaa ccccccc 

the output needs be:

bbbbbbb aaaaaaa ccccccc 

do need run loop of sort or can done uniq? and, yes, know sorting backwards give me output that's not want.

thanks.

add sequential field beginning of each line using paste (1,2,3...), reverse list based on field, , run uniq ignoring field. sort field insure have remained in right order. remove field using cut or colrm.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -