2018-11-19 09:52:12 +00:00
|
|
|
# comp
|
|
|
|
|
|
|
|
> Compare the contents of two files or sets of files.
|
|
|
|
> Use wildcards (*) to compare sets of files.
|
2022-10-04 16:06:23 +01:00
|
|
|
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/comp>.
|
2018-11-19 09:52:12 +00:00
|
|
|
|
|
|
|
- Compare files interactively:
|
|
|
|
|
|
|
|
`comp`
|
|
|
|
|
|
|
|
- Compare two specified files:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`comp {{path\to\file1}} {{path\to\file2}}`
|
2018-11-19 09:52:12 +00:00
|
|
|
|
2018-11-20 09:07:03 +00:00
|
|
|
- Compare two sets of files:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`comp {{path\to\directory1}}\* {{path\to\directory2}}\*`
|
2018-11-20 09:07:03 +00:00
|
|
|
|
2018-11-19 09:52:12 +00:00
|
|
|
- Display differences in decimal format:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`comp /d {{path\to\file1}} {{path\to\file2}}`
|
2018-11-19 09:52:12 +00:00
|
|
|
|
|
|
|
- Display differences in ASCII format:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`comp /a {{path\to\file1}} {{path\to\file2}}`
|
2018-11-19 09:52:12 +00:00
|
|
|
|
|
|
|
- Display line numbers for differences:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`comp /l {{path\to\file1}} {{path\to\file2}}`
|
2018-11-19 09:52:12 +00:00
|
|
|
|
2018-11-20 09:08:14 +00:00
|
|
|
- Compare files case-insensitively:
|
2018-11-19 09:52:12 +00:00
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`comp /c {{path\to\file1}} {{path\to\file2}}`
|
2018-11-19 09:52:12 +00:00
|
|
|
|
|
|
|
- Compare only the first 5 lines of each file:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`comp /n={{5}} {{path\to\file1}} {{path\to\file2}}`
|