nerdexam
Cisco

200-901 · Question #239

Refer to the exhibit. The output of the diff -u README.md-repo README.md command is shown. The original file was 165 lines long. How many lines are in the edited copy of the file?

The correct answer is C. 172. In unified diff format (diff -u), lines prefixed with '-' indicate removals and lines prefixed with '+' indicate additions. The @@ hunk headers show the original and new line ranges. Starting from the original 165 lines, the exhibit's diff output shows a net addition of 7 lines…

Infrastructure and Automation

Question

Refer to the exhibit. The output of the diff -u README.md-repo README.md command is shown. The original file was 165 lines long. How many lines are in the edited copy of the file?

Exhibit

200-901 question #239 exhibit

Options

  • A162
  • B165
  • C172
  • D173

How the community answered

(37 responses)
  • A
    5% (2)
  • B
    14% (5)
  • C
    78% (29)
  • D
    3% (1)

Explanation

In unified diff format (diff -u), lines prefixed with '-' indicate removals and lines prefixed with '+' indicate additions. The @@ hunk headers show the original and new line ranges. Starting from the original 165 lines, the exhibit's diff output shows a net addition of 7 lines (more '+' lines than '-' lines across all hunks). Therefore: 165 + 7 = 172 lines in the edited file. This matches option C (172). Options A (162) and D (173) reflect incorrect arithmetic, and B (165) would mean no net change.

Topics

#diff utility#file comparison#command-line interface#version control basics

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice