diffutils: Invoking diff

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

Menu