🧀 Learn Linux

Advanced·Reading and processing text

diff: Compare two text files

Put in free practice

Syntax

diff file 1 file 2

Examples

diff projects/notes.txt README.txt

Usage and sandbox support

Returns 0 if they are the same and 1 if they are different. The sandbox displays two copies of the content and does not emulate the full diff patch format.

Hands-on exercises

Full documentation ↗

Related commands