nerdexam
LPI

102-500 · Question #153

Which command would you use to apply the changes in a diff file to your existing kernel source?

The correct answer is B. patch. patch is the correct answer because it is specifically designed to apply diff files to source code - it reads the unified or context diff format produced by the diff command and applies those changes to the target files in place. The distractors are wrong for these reasons…

Administrative Tasks

Question

Which command would you use to apply the changes in a diff file to your existing kernel source?

Options

  • Aup2date
  • Bpatch
  • Crpm
  • Ddpkg
  • Ediff

How the community answered

(28 responses)
  • A
    4% (1)
  • B
    82% (23)
  • C
    4% (1)
  • E
    11% (3)

Explanation

patch is the correct answer because it is specifically designed to apply diff files to source code - it reads the unified or context diff format produced by the diff command and applies those changes to the target files in place.

The distractors are wrong for these reasons: up2date (A) is a Red Hat package update tool for fetching RPM updates from a repository; rpm (C) is the Red Hat Package Manager for installing/removing .rpm packages; dpkg (D) is the Debian package manager for .deb packages; and diff (E) generates the difference between two files but cannot apply changes - it is the source, not the consumer, of diff output.

Memory tip: think of it as a logical pair - diff creates the patch file, patch applies it. The command name literally mirrors the file type: you use patch on a .patch (or .diff) file.

Topics

#patch command#diff files#kernel source#file patching

Community Discussion

No community discussion yet for this question.

Full 102-500 Practice