diff(1) - SerenityOS man pages

#Name

diff - compare files line by line

#Synopsis

$ diff [options...] [files...]

#Description

Compare files line by line.

#Arguments

#Options

#Examples

First we create two files to compare:

$ printf '1\n2\n3\n' > file1
$ printf '1\nb\n3\n' > file2

Here's how to view differences between the two files in normal format:

$ diff file1 file2
2c2
< 2
---
> b

Here's how to view differences between the two files in unified format:

$ diff -u file1 file2
--- file1
+++ file2
@@ -1,3 +1,3 @@
 1
-2
+b
 3