PrepAway - Latest Free Exam Questions & Answers

which of the following commands should be used to apply the patch /tmp/foopatch?

If the current directory is /root and the kernel source is located in /usr/src/linux, which of the
following commands should be used to apply the patch /tmp/foopatch?

PrepAway - Latest Free Exam Questions & Answers

A.
cat /tmp/foopatch | patch -p0

B.
cd/usr/src/linux; cat/tmp/foopatch | patch -p0

C.
cd/usr/src/linux; cat/tmp/foopatch | patch

D.
cd/usr/src/linux; patch -p1 </tmp/foopatch

E.
cd/usr/src/linux; patch -p1 >/tmp/foopatch

Explanation:
From the man pages:
Patch takes a patch file patchfile containing a difference listing produced by the diff program and
applies those differences to one or more original files, producing patched versions. Normally the
patched versions are put in place of the originals. […] If no original file origfile is specified on the
command line, patch tries to figure out from the leading garbage what the name of the file to edit is.

One Comment on “which of the following commands should be used to apply the patch /tmp/foopatch?


Leave a Reply