diffutils: Invoking diff

 
 13 Invoking 'diff'
 ******************
 
 The format for running the 'diff' command is:
 
      diff OPTIONS... FILES...
 
    In the simplest case, two file names FROM-FILE and TO-FILE are given,
 and 'diff' compares the contents of FROM-FILE and TO-FILE.  A file name
 of '-' stands for the standard input.
 
    If one file is a directory and the other is not, 'diff' compares the
 file in the directory whose name is that of the non-directory.  The
 non-directory file must not be '-'.
 
    If two file names are given and both are directories, 'diff' compares
 corresponding files in both directories, in alphabetical order; this
 comparison is not recursive unless the '--recursive' ('-r') option is
 given.  'diff' never compares the actual contents of a directory as if
 it were a file.  The file that is fully specified may not be standard
 input, because standard input is nameless and the notion of "file with
 the same name" does not apply.
 
    If the '--from-file=FILE' option is given, the number of file names
 is arbitrary, and FILE is compared to each named file.  Similarly, if
 the '--to-file=FILE' option is given, each named file is compared to
 FILE.
 
    'diff' options begin with '-', so normally file names may not begin
 with '-'.  However, '--' as an argument by itself treats the remaining
 arguments as file names even if they begin with '-'.
 
    An exit status of 0 means no differences were found, 1 means some
 differences were found, and 2 means trouble.
 

Menu