patch
1. Apply patch foo.patch
The number in -p<num> controls how many directory levels to remove
from the file paths inside the patch (at the top of foo.patch).
-p0keep the full path unchanged-p1remove one directory level-p2remove two directory level etc
patch -p1 < foo.patch