diff - Linux command line tool to find differences between files
Follow @ggarronWhenever you need to find the differences between two files you should use diff
Diff will output the parts of the files where they are different.
Usage
diff [options] file1 file2 diff [options] file1 directory diff [options] directory file2 diff [options] directory1 directory2
file1 and file2 are the files to be compared, but when you use a directory and a file you diff will find a file in directory which file is the same as the compared file, when two directories are used diff will look in both directories for files with the same names to be compared.
Options
-i --ignore-case
Ignore case differences in file contents.
--ignore-file-name-case
Ignore case when comparing file names.
--no-ignore-file-name-case
Consider case when comparing file names.
-E --ignore-tab-expansion
Ignore changes due to tab expansion.
-b --ignore-space-change
Ignore changes in the amount of white space.
-w --ignore-all-space
Ignore all white space.
-B --ignore-blank-lines
Ignore changes whose lines are all blank.
-I RE --ignore-matching-lines=RE
Ignore changes whose lines all match RE.
--strip-trailing-cr
Strip trailing carriage return on input.
-a --text
Treat all files as text.
-c -C NUM --context[=NUM]
Output NUM (default 3) lines of copied context.
-u -U NUM --unified[=NUM]
Output NUM (default 3) lines of unified context.
--label LABEL
Use LABEL instead of file name.
-p --show-c-function
Show which C function each change is in.
-F RE --show-function-line=RE
Show the most recent line matching RE.
-q --brief
Output only whether files differ.
-e --ed
Output an ed script.
--normal
Output a normal diff.
-n --rcs
Output an RCS format diff.
-y --side-by-side
Output in two columns.
-W NUM --width=NUM
Output at most NUM (default 130) print columns.
--left-column
Output only the left column of common lines.
--suppress-common-lines
Do not output common lines.
-r --recursive
Recursively compare any subdirectories found.
A good one option is the -y --side-by-side as it will display the differences in two columns you can also use the command sdiff to reproduce the -y parameter.