One linux command per day: diff

Source: Internet
Author: User
The diff command is used to compare the content of a file line by line and list its differences. Diff -- help can be used to view command parameters. Difffile1file2 compares the content in file1 and file2. the displayed results are as follows: 1c1, 3 & lt; hello --- & gt; world & gt; 123 & gt; 23-letter-old pair...
The diff command is used to compare the content of a file line by line and list its differences. Diff -- help can be used to view command parameters. Diff file1 file2 compares the content in file1 and file2. the format of the result is as follows: 1c1, 3 World> 123> 23 the corresponding file1 file before the letter, and the corresponding file2 file after the letter, the letter form is as follows: a (add), d (delete), c (Modify ). Number indicates the number of rows. Www.2cto.com <Followed by the content in file1,> Followed by the content in file2. --- It is a gorgeous split line. You can also use the standard input instead of the file, that is, do not write the file name, use-(minus sign) instead, then use the standard input, and use ctrl + D to end. The output content format is similar to the preceding one. You can also choose not to specify a file. if you use a directory, the files with the same file name are automatically compared. The following describes the available parameters:-I ignore case sensitivity. -B ignores multiple spaces. Multiple spaces are considered as one. -W ignores all spaces. -B ignores empty rows. -Q only shows whether there are any differences. -The content of files y is displayed in two columns. Author: CrazyNemo
Related Article

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.