dircmp(1) dircmp(1)
NAME
dircmp - directory comparison
SYNOPSIS
dircmp [-d] [-s] [-w n] [--] dir1 dir2
DESCRIPTION
dircmp compares two directories dir1 and dir2 and tells you whether
they contain files of the same name and whether such files also have
the same contents.
OPTIONS
No option specified:
dircmp first lists the file names that are unique to each direc-
tory. Files from dir1 are shown on the left, while files from
dir2 appear on the right. The output is generated in the follow-
ing format:
Nov 16 10:42 1987 dir1 only dir2 only Page 1
./filename1 ./filename2
. .
. .
. .
. .
The next set of lines provides information as to whether files
common to the two directories have the same contents. If this is
the case, they are listed in a line that begins with same; if
not, in a line that begins with different. The generated output
is in the following format:
directory .
different ./filename in dir1 and dir2
.
.
.
same ./filename in dir1 and dir2
-d dircmp compares the contents of identically named files in dir1
and dir2 and outputs the results in a diff-like format. The
result of this comparison is output immediately after the file
name comparison.
-s dircmp suppresses information about the contents of common files.
-w n The width of the output line is changed to n characters. The
default width is 72 characters per line.
-- If dir1 begins with a dash (-), the end of the command-line
options must be marked with --.
Page 1 Reliant UNIX 5.44 Printed 11/98
dircmp(1) dircmp(1)
dir1 dir2
Names of the directories you wish to compare.
LOCALE
The LCMESSAGES environment variable governs the language in which
message texts are displayed. If LCMESSAGES is undefined or is defined
as the null string, it defaults to the value of LANG. If LANG is like-
wise undefined or null, the system acts as if it were not internation-
alized.
The LCALL environment variable governs the entire locale. LCALL
takes precedence over all the other environment variables which affect
internationalization.
EXAMPLES
Comparison of the two directories A and B, which have the following
contents:
_________________________________________
| Directory | File names | File contents |
||||
| A | a | aaaaaaa |
| |____________|_______________|
| | b | bbbb |
| |____________|_______________|
| | c | cccc |
| |____________|_______________|
| | d | dddd |
|___________|____________|_______________|
| B | a | aaaaaaaaa |
| |____________|_______________|
| | b | BBBB |
| |____________|_______________|
| | C | cccc |
| |____________|_______________|
| | d | dddd |
|___________|____________|_______________|
Page 2 Reliant UNIX 5.44 Printed 11/98
dircmp(1) dircmp(1)
Calling dircmp with the -d option:
$ dircmp -d A B
Nov 16 10:42 1987 A only and B only Page 1
./c ./C
Nov 16 10:42 1987 Comparison of A B Page 1
directory .
different ./a
different ./b
same ./d
Nov 16 10:42 1987 difference of ./a in A and B Page 1
1c1
< aaaaaaa
---
> aaaaaaaaa
Nov 16 10:42 1987 difference of ./b in A and B Page 1
1c1
< bbbb
---
> BBBB
SEE ALSO
cmp(1), diff(1).
Page 3 Reliant UNIX 5.44 Printed 11/98