Use diff to generate patches and patch patches in Linux

Source: Internet
Author: User
Tags diff

1, using diff to generate patches;

Diff is the file comparison command under Linux, the parameters are not said here, direct man a bit on the line, not only can compare files, can also compare two directories, and can be different to generate patch files, in fact, is a patch of command. Here's how to use it:

Diff-rnu a B > Diff.patch

Where a is an old directory or file, B is a recently modified directory or file, and a patch file is generated.

2, use patch patching;

The parameters of the patch command are described in the Man manual, and patches are used to patch the other a directories as follows:

Patch-p0 < Diff.patch

Use diff to generate patches and patch patches in Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.