I have the file:
key value blah blah blah blah blahblah man1 boy1 blah blah man1 boy2 man1 boy1 I do this to remove duplicate lines:
awk '/man1/ { print $1,$2} ' file | awk '!x[$0]++' and the command take the first line and ignore other lines
man1 boy1 man1 boy2 but I want to ignore all lines except the last line:
man1 boy2 man1 boy1 as ramesh said I want something like:
cat filename blah blah blah blah blahblah man1 boy1 blah blah man1 boy2 man1 boy1 man1 boy2 man1 boy3 man1 boy4 man1 boy2 the desired output
man1 boy1 man1 boy3 man1 boy4 man1 boy2
boy1is the last valueman1take it,see updatesblah blahis duplicated 3 times? You should really clarify what do you want and provide a better example.blah blahis a not wanted text see updates