Compares two directories and the contents of their common files.
The dircmp command compares the two directories specified by the Directory1 and Directory2 parameters and writes information about their contents to standard output. First, the dircmp command compares the file names in each directory. If the same file name appears 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 diff -r command offers a function similar to the dircmp command.
Item | Description |
---|---|
-d | Displays for each common file name both versions of the differing file contents. The display format is the same as that for the diff command. |
-s | Does not list the names of identical files. |
-w num | Change the width of the output to num number of characters. |
This command returns the following exit values:
Item | Description |
---|---|
0 | Successful completion. |
>0 | An error occurred. |
Note: Differences in directory contents are not considered errors.
dircmp proj.ver1 proj.ver2
This displays
a summary of the differences between the directories proj.ver1 and proj.ver2. 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.$dircmp -w 90 dir1 dir2
Item | Description |
---|---|
/usr/bin/dircmp | Contains the dircmp command. |
The cmp command, diff command.
Directories in AIX® Version 7.1 Operating system and device management describes the structure and characteristics of directories in the file system.
Input and output redirection in AIX Version 7.1 Operating system and device management describes how the operating system processes input and output.