Multiple choice technology

What is the command to find the differences in the lines containing "1999" between the files orig.txt and copy.txt, and add the result to file result.1999?

  1. diff orig.txt -d copy.txt | grep 1999 > result.1999

  2. diff orig.txt copy.txt | grep 1999 >> result.1999

  3. grep 1999 *.txt >> result.1999

  4. diff orig.txt copy.txt | grep 1999 << result.1999

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The command 'diff orig.txt copy.txt | grep 1999 >> result.1999' correctly finds differences between files, filters for lines containing '1999', and appends results to the output file. The >> operator appends rather than overwrites. Option A uses invalid -d flag, D uses incorrect redirection <<, and C doesn't compare files.