Working with patch files CREATING patch file diff -Naur oldpath newpath > file.patch Where the path items may be single files or directories. Both the old ad new items should have the same number of directory levels. N.b.: Beware the "a" switch. Says to treat all files as ASCII. Why not let diff decide whether the files are ASCII? APPLYING a patch file Take a look at the patch file to see where it expects the source and directory elements to be relative to. cd somewhere # based on findings above patch -pX < file.patch The number X is the number of levels to strip off of the paths in the patch file. If you specify no -p at all, ALL directories are stripped off. If patch is created well, and you restore from the right location, you normally want to give "-p0". SIMPLE USE SPECIFYING INDIVIDUAL FILES To patch one or more files in a single directory, just get old and new files in two peer directories at the same level. Name one of the directories to indicate that it contains the older or newer files. It's fine if either directories contain other files not used for the patch. Go to the parent directory and run diff -Naur olddir/file1 newfile/file1 > file.patch diff -Naur olddir/file2 newfile/file2 >> file.patch ... [N.b.: The "r" switch should not be necessary] Note that the element may not exist in olddir or in newdir, in which case the patch file will instruct to add or remove the file. To apply, just cd to an olddir and run patch < file.patch