Working with files and directories

Comparing directories

Comparing directories is useful when two people are working on the same set of files, for example, the chapters of a book. By comparing the directories you can quickly identify which files are different.

To compare two directories, use the dircmp(C) (directory compare) command, as follows:

dircmp directory1 directory2

The output is a list of the differences between the directory listings for directory1 and directory2, for example:

   $ dircmp ./dir1 ./dir2
   Jan 12 10:54 1995  dir1 only and dir2 only Page 1
   

./t.appx.s ./t.prog.s ./t.scosh.s ./t.shell.s . . . Jan 12 10:54 1995 Comparison of dir1 dir2 Page 1

directory . same ./0.ct.s same ./00.partno.s same ./00.title.s . . .

The top of the listing consists of those files which are unique to one or other of the directories; in this example, dir2 contains four files which are not present in dir1. The listing then contains a detailed comparison of every file which is named in both directories.

Next topic: Navigating the filesystem
Previous topic: Removing a directory

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005