Reference articles on history, science, culture and more
Encyclopedia

Comp (command)

Command

Image credit is listed at the end of this article.

In computing, comp is a command used on DEC OS/8, DOS, DR FlexOS, IBM OS/2, Microsoft Windows and related computer operating systems such as ReactOS. It is used to perform comparisons of multiple computer files to show the differences between them.

01History

In DOS, the comp command first appeared in PC DOS 1.0 and has been included in most versions of MS-DOS and PC DOS. A newer command, fc was added in DOS 3.3 which allows for line comparisons in addition to binary comparisons. DR DOS 6.0 also includes an implementation of the comp command.

The FreeDOS version was developed by Paul Vojta and is licensed under the MIT License. Ged Murphy developed the ReactOS version. It is licensed under the GNU GPL 2.

The command is also available in the EFI shell.

COMP.COM (among other commands) in IBM PC DOS 1.0.
COMP.COM (among other commands) in IBM PC DOS 1.0.

02Syntax

The command-syntax is:

comp [<Data1>] [<Data2>] [/d] [/a] [/l] [/n=<Number>] [/c]

Parameters

  • <Data1>, Location and name of the first file or set of files
  • <Data2>, Location and name of the second file or set of files
  • /d, Display differences in decimal format (Default is hexadecimal)
  • /a, Display differences as characters
  • /l, Display the number of the line, instead of the byte offset
  • /n=<Number>, Compare only the specified number of lines for each file
  • /c, Perform a non case-sensitive comparison
  • /off[line], Process files with the offline attribute set
  • /?, Display Help
Watch videos about Comp (command)Explainers and documentaries on YouTube (opens in a new tab)

Sources and credits

This article is adapted from the Wikipedia article Comp (command), written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.

Images, from Wikimedia Commons:

Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.