tldr/pages/windows/comp.md

38 lines
883 B
Markdown
Raw Normal View History

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.
2019-08-22 13:37:57 +01:00
> More information: <https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/comp>.
2018-11-19 09:52:12 +00:00
- Compare files interactively:
`comp`
- Compare two specified files:
`comp {{path/to/file_1}} {{path/to/file_2}}`
2018-11-20 09:07:03 +00:00
- Compare two sets of files:
`comp {{path/to/directory_1/*}} {{path/to/directory_2/*}}`
2018-11-19 09:52:12 +00:00
- Display differences in decimal format:
`comp /d {{path/to/file_1}} {{path/to/file_2}}`
- Display differences in ASCII format:
`comp /a {{path/to/file_1}} {{path/to/file_2}}`
- Display line numbers for differences:
`comp /l {{path/to/file_1}} {{path/to/file_2}}`
- Compare files case-insensitively:
2018-11-19 09:52:12 +00:00
`comp /c {{path/to/file_1}} {{path/to/file_2}}`
- Compare only the first 5 lines of each file:
`comp /n={{5}} {{path/to/file_1}} {{path/to/file_2}}`