bash merge 2 lists removing duplicated

view story

http://serverfault.com – I have an embedded linux system using Busybox (OpenWRT) - so commands are limited. I have two files that look like: first file aaaaaa bbbbbb cccccc mmmmmm nnnnnn second file mmmmmm nnnnnn yyyyyy zzzzzz I need to merge these 2 lists into 1 file, and remove the duplicates. I don't have diff (space is limited) so we get to use the great awk, sed, and grep (or other tools that might be included in a standard Busybox instance). Going to a merge file like: command1 > mylist.merge command2 mylist.merge > originallist is totally ok. It doesn't have to be a single-line command. (HowTos)