# diff(3)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

diff - Difference files or directories
diff-changes - Find the differences from a previous edit session
rdiff - Recursively compare files or directories
%diff-com - Diff command line

## SYNOPSIS

diff "old-version" "new-version"
diff-changes
rdiff "old-version" "new-version"
`%diff-com` "string"; Default is "`diff`"

## DESCRIPTION

diff executes the diff(1) command with the command line set by the %diff-com(5) variable and the user supplied old-version and new-version. The output of the command is piped into the *diff* buffer and is hilighted to show the changes (GNU diff only).

Your version of diff(1) will determine whether it is possible to difference directories.

diff-changes is a simple macro that differences the current buffer and the last backup of the associated file. It is a quick way to determine what has been modified recently. This macro only works if a backup file exists.

rdiff operates in the same way as diff except it launches the diff(1) command with an extra -r option which enables recursive compare (i.e. compares the contents of sub-directories as well). Your version of diff must support this option for rdiff to operate correctly.

%diff-com is the command line that is used to execute a diff(1) system command.

For GNU diff then the following command line setting is recommended:-

    diff --context --minimal --ignore-space-change \
        --report-identical-files --recursive

which should be defined in your personal user configuration. This is the default for Linux.

## NOTES

diff, diff-changes and rdiff are macros defined in `tools.emf`.

diff(1) must be executable on the system before diff or diff-changes can function.

diff(1) is a standard utility on UNIX systems. For Windows 95/NT a version of GNU diff may be found at:

<ftp.winsite.com/ftp/pub/pc/winnt/misc/gnudiff.zip>

For MS-DOS users, a DJGPP port of diff is also available on the net. A commercial version of diff is also available from MKS.

## SEE ALSO

compare-windows(2), compile(3), gdiff(3), xgrep(3), %xgrep-com(5), xdiff(3), %xdiff-com(5).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>