I don't really know awk, but my attempt so farhistory | awk '!x[<everything except first column which is the order>]++' | sort -r
How to sort shell history by recency and remove duplicates?
awk;sort;command history