tldr/pages/common/cmp.md

13 lines
368 B
Markdown
Raw Normal View History

2016-02-23 01:29:35 +00:00
# cmp
2021-03-31 11:29:51 +01:00
> Compare two files byte by byte.
> More information: <https://www.gnu.org/software/diffutils/manual/html_node/Invoking-cmp.html>.
2016-02-23 01:29:35 +00:00
2021-03-31 11:29:51 +01:00
- Find the byte and line number of the first difference between two files:
2016-02-23 01:29:35 +00:00
2021-03-31 11:29:51 +01:00
`cmp {{path/to/file1}} {{path/to/file2}}`
2016-02-23 01:29:35 +00:00
- Find the byte number and differing bytes of every difference:
2021-03-31 11:29:51 +01:00
`cmp -l {{path/to/file1}} {{path/to/file2}}`