Merge two files interactively. Show the differences, with output to outfile.

      sdiff -o outfile [options] from-file to-file


   Multiple single letter options (unless they take an argument)
   can be combined into a single command line argument.

   --text Treat all files as text and compare them line-by- line,
          even if they do not appear to be text.

          Ignore changes in amount of white space.

          Ignore changes that just insert or delete blank lines.

          Change the algorithm to perhaps find a smaller set of changes.
          This makes sdiff slower (sometimes much slower).

          Use heuristics to speed  handling of large files that have numerous scattered small changes.

          Ignore changes in case; consider upper- and lower-case to be the same.

   -I regexp
          Ignore changes that just insert or delete lines that match regexp.

          Ignore white space when comparing lines.

          Ignore changes that just insert or delete lines that match regexp.

          Print only the left column of two common lines.

   -o file
          Put merged output into file. This option is required for merging.

          Do not print common lines.

          Expand tabs to spaces in the output, to preserve the alignment of tabs
          in the input files.

          Output the version number of sdiff.

   -w columns
          Use an output width of columns.  Note that for historical reasons,
          this option is -W in diff, -w in sdiff.

Long named options can be abbreviated to any unique prefix of their name.

If from-file is a directory and to-file is not, sdiff compares the file in from-file whose file name is that of to-file, and vice versa. from-file and to-file can not both be directories.

sdiff options begin with -, so normally from-file and to-file can not begin with -. However, -- as an argument by itself treats the remaining arguments as file names even if they begin with -.

You can not use - as an input file.

sdiff without -o (or --output) produces a side-by-side difference. This usage is obsolete; use diff --side-by-side instead.

An exit status of 0 means no differences were found, 1 means some differences were found, and 2 means trouble.

“Eventually, all things merge into one, and a river runs through it” ~ Norman Maclean

Related Linux commands

cmp - Compare two files.
diff - Display the differences between two files.
diff3 - Show differences among three files.
Equivalent Windows commands: COMP / FC - Compare and display Characters/Lines which do not match.

Copyright © 1999-2024
Some rights reserved