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…
Question
Options
- Aup2date
- Bpatch
- Crpm
- Ddpkg
- Ediff
How the community answered
(28 responses)- A4% (1)
- B82% (23)
- C4% (1)
- E11% (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
Community Discussion
No community discussion yet for this question.