Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Just started with diff command. Can you please explain me,

diff thin_provisionings_controller.rb thin_provisionings_controller.rb[211]


   include ThinProvisioningsGraphModule

So does that says to delete lines 512, 513 and add 511? As described by this article http://lowfatlinux.com/linux-compare-files-diff.html

share|improve this question

migrated from stackoverflow.com Feb 22 '12 at 14:35

This question came from our site for professional and enthusiast programmers.

I recommend you use unified diffs (add -u). They're easier to read and more resilient to unrelated changes. – Matthew Flaschen Feb 20 '12 at 2:15
up vote 4 down vote accepted

Use diff -y, which stands for diff --side-by-side. It will show the output in two columns, one for each file. The columns will be in the same order you input the files on the command line.

share|improve this answer
Wow! I never knew about the -y option! – Barun Feb 22 '12 at 17:41

Watch this video which will explain everything you want.

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.