0

For example, I have two files. They are not sorted. File1:

apple
banana
pineapple

File2:

pineapple
blueberry
banana

I want to echo fruits that only exist in file1, not in file2. And in this case, it's apple.(even we have pineapple)

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
Dave
  • 1
  • Do you need your output to respect the current ordering of items in the files, or is it fine if the output is in sorted order? – Charles Duffy Jun 25 '22 at 15:58
  • Also, what do you know about the real-world size bounds? Is it possible for the files to be too large to fit in memory? Too large to have temporary copies made on disk? – Charles Duffy Jun 25 '22 at 15:58
  • ...mind, in pretty much any case the answer you end up with will be either `comm` or `awk` (in the former case, with transient `sort` invocations for both inputs). – Charles Duffy Jun 25 '22 at 15:59

0 Answers0