Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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

share|improve this question

migrated from 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

2 Answers 2

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.