Comparing the contents of directories (dircmp command)

Use the dircmp command to compare two directories specified by the Directory1 and Directory2 parameters and write information about their contents to standard output.

First, the dircmp command compares the file names in each directory. If the same file name is contained in both, the dircmp command compares the contents of both files.

In the output, the dircmp command lists the files unique to each directory. It then lists the files with identical names in both directories, but with different contents. If no flag is specified, it also lists files that have identical contents as well as identical names in both directories.

The following are examples of how to use the dircmp command:
  • To summarize the differences between the files in the proj.ver1 and proj.ver2 directories, type the following:
    dircmp proj.ver1 proj.ver2
    This displays a summary of the differences between the proj.ver1 and proj.ver2 directories. The summary lists separately the files found only in one directory or the other, and those found in both. If a file is found in both directories, the dircmp command notes whether the two copies are identical.
  • To show the details of the differences between the files in the proj.ver1 and proj.ver2 directories, type the following:
    dircmp -d -s proj.ver1 proj.ver2
    The -s flag suppresses information about identical files. The -d flag displays a diff listing for each of the differing files found in both directories.