dircmp - Compare directories
Format
dircmp [-Bds] [-W option[option] ... dir1 dir2
Description
dircmp examines dir1 and dir2 and generates listings about the contents of the directories. Listings of files that are unique to each directory are generated for all the options. If no option is entered, a list is output indicating whether the file names that are common to both directories have the same contents.
Options
- -B
- Disables the automatic conversion of tagged files. This option is ignored if the filecodeset or pgmcodeset options (-W option) are specified.
- -d
- Compares the contents of files with the same name in both directories and creates a list telling what must be changed in the two files to bring them into agreement. The list format is described in diff.
- -s
- Suppress messages about identical files.
- -W option[,option]...
- Specifies z/OS-specific options. The option keywords are case-sensitive. Possible
options are:
- filecodeset=codeset
- Performs text conversion from one code set to another when reading from the file. The coded
character set of the file is codeset. codeset
can be a code set name that is known to the system or a numeric coded character set identifier
(CCSID). Note that the command
iconv -l
lists existing CCSIDs along with their corresponding code set names. The filecodeset and pgmcodeset options can be used on files with any file tag.If pgmcodeset is specified but filecodeset is omitted, then the default file code set is ISO8859-1 even if the file is tagged with a different code set. If neither filecodeset nor pgmcodeset is specified, text conversion will not occur unless automatic conversion is enabled or the _TEXT_CONV environment variable indicates text conversion. For more information about text conversion, see Controlling text conversion for z/OS UNIX shell commands.
If filecodeset or pgmcodeset is specified, then automatic conversion is disabled for this command invocation and the -B option is ignored if it is also specified. For more information about automatic conversion, see Converting files between code pages in z/OS UNIX System Services Planning.
When specifying values for filecodeset, use the values that Unicode Service supports.
- pgmcodeset=codeset
- Performs text conversion from one code set to another when reading from the file. The coded
character set of the program (command) is codeset.
codeset can be a code set name that is known to the system or a numeric
coded character set identifier (CCSID). The command
iconv -l
lists existing CCSIDs along with their corresponding code set names. The filecodeset and pgmcodeset options can be used on files with any file tag.If filecodeset is specified but pgmcodeset is omitted, then the default program code set is IBM-1047. If neither filecodeset nor pgmcodeset is specified, text conversion will not occur unless automatic conversion is enabled or the _TEXT_CONV environment variable indicates text conversion. For more information about text conversion, see Controlling text conversion for z/OS UNIX shell commands.
If filecodeset or pgmcodeset is specified, then automatic conversion is disabled for this command invocation and the -B option is ignored if it is also specified. For more information about automatic conversion, see Converting files between code pages in z/OS UNIX System Services Planning.
Restriction: The only supported values for pgmcodeset are IBM-1047 and 1047.
Examples
- To compare the contents of two directories, showing files that
are identical, files that differ, and files or directories that are
unique to a directory:
dircmp MyDir01 MyDir02
- To compare the contents of two directories and only show files
that differ, along with a listing of those differences, and files
or directories that are unique to a directory:
dircmp -ds MyDir01 MyDir02
- To compare the contents of two directories that consists of text files containing ASCII
characters, showing files that are identical, files that differ, along with a listing of those
differences, and files or directories that are unique to a directory, assuming that:
- The text files are untagged and you do not want to tag them or enable automatic conversion, and
- You cannot alter the tag (for example, you are comparing untagged public text files or read-only text files):
dircmp -d -W filecodeset=ISO8859-1,pgmcodeset=IBM-1047 MyAsciiDir01 MyAsciiDir02
- To compare the contents of two directories consisting of text
files containing EBCDIC characters and only show files that differ,
along with a listing of those differences, and files or directories
that are unique to a directory, assuming that automatic conversion
has been enabled but the text files are incorrectly tagged as UTF-8:
dircmp -Bds MyMisTaggedDir01 MyMisTaggedDir02
Localization
- LANG
- LC_ALL
- LC_MESSAGES
- NLSPATH
Environment variables
- _TEXT_CONV
- Contains text conversion information for the command. The text conversion information is not used when either the -B option or the filecodeset or pgmcodeset option (-w option) is specified. For more information about text conversion, see Controlling text conversion for z/OS UNIX shell commands.
Exit values
0
- Successful completion.
>0
-
- The code set is not valid.
- Could not turn off automatic conversion.
- Could not perform requested text conversion.
Related information
cmp, diff