一工夫すれば順番を維持する事も可能。

cat -n | sort -k 2 -u | sort -n | cut -f 2-