Diff is the command used in Linux to compare folders and file contents in a simple and understandable language description:
Based on the file (or folder) to which the first parameter of diff points, compares the file (or folder) to which the second parameter points, and returns the result of the comparison.
(1) hold a chestnut and perform a comparison with the command diff./test1.txt./test2.txt. The two files Test1.txt and test2.txt contents are as follows:
I'm test001123 the same line test001 unique test multiple rows---gorgeous split line---
I'm test002 the same line---gorgeous split line---test002 exclusive asdf
(2) Execution results
Result analysis
Simply put, the letters "a", "D", and "C", respectively, are added, deleted, and modified as the results are separated from the Middle English letters.
Give me a chestnut, the first line:1,2c1
The 1th to 2nd line of the first file test1.txt is not the same as the 1th line of Test2.txt.
Then follow the following content, meaning: the 1th to 2nd line of Test1.txt is the beginning of the < section, with a different test2.txt 1th line content is > the beginning of the section,---as a split line
< I'm test001.
< 123
---
> I'm test002.
In other words:
The 1th to 2nd line of Test1.txt is:
I'm test001.
< 123
1th to 1th line of content with Test2.txt
I'm test002.
Different
The Linux file Comparison diff command