🎴 Flashcard Mode

Web Development and Unix Fundamentals

Card1 / 20
Mastered0
Review0
QuestionClick to flip

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?

AnswerClick to flip back
A
diff orig.txt copy.txt | grep 1999 >> result.1999
💡 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.

Change Mode