November 2015
Beginner
282 pages
5h 5m
English
A comparison between two similar files makes sense in order to know what differences exist between the two files. For example, comparing the results obtained by a command ran on two sets of data. Another example can be comparing an older and a newer version of a shell script file in order to know what modifications have been made in script. Shell provides the diff command for file comparison.
The diff command is used to compare files line by line. The syntax of using the diff command is as follows:
diff [option] file1 file2
Where, file1 and file2 are the files to be compared.
The options of the
diff command are explained in the following table:
|
Option |
Description |
|---|---|
|
|
Only print if files differ |
|
|
Read now
Unlock full access