Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

NAME

compare - compare files line by line

SYNOPSIS

compare [OPTION...] FILE_A FILE_B

DESCRIPTION

Compare FILE_A vs FILE_B and generate comparison results in a new tab.

OPTIONS

-a TAB_NAME

Rename the left file name in the comparison results

-b TAB_NAME

Rename the right file name in the comparison results

EXAMPLES

To compare two files

Code Block
compare FileName1 FileName2

To compare two files, renaming the first file to tab1 in the comparison results

Code Block
compare -a tab1 FileName1 FileName2

To compare two files, renaming the second file to tab2 in the comparison results

Code Block
compare -b tab2 FileName1 FileName2

To compare two files, renaming the first file to tab1 and renaming the second file to tab2 in the comparison results

Code Block
compare -a tab1 -b tab2 FileName1 FileName2

To compare two files, renaming the first file (found in the /home/username/ directory) to tab1, and renaming the second file (found in the current working directory) to tab2 in the comparison results

Code Block
compare -a tab1 -b tab2 /home/username/FileName1 FileName2

To compare two files, renaming the first file (found in the current working directory) to tab1, and renaming the second file (found in c:/directory ) to tab2 in the comparison results

Code Block
compare -a tab1 -b tab2 FileName1 c:/directory/FileName2

To compare two files, renaming the first file to tab1 and renaming the second file to tab2 in the comparison results

Code Block
compare -a tab1 FileName1 -b tab2 FileName2

To compare two files, renaming the first file to tab2 and renaming the second file to tab1 in the comparison results

Code Block
compare -b tab2 FileName1 -a tab1 FileName2