Linux

diff

SafeCompare files

diff -u <file1> <file2>

Shows differences. -u gives unified format (patch standard); -r compares directories. Vital for config review.

Examples

  • diff -u nginx.conf nginx.conf.bakReview config changes
  • diff -r dirA dirBCompare directories

Syntax

diff [-u] [-r] <a> <b>

Before you run it

Read only.

Related commands

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store