The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
diff command ariec AIX 3 06-05-2008 03:16 AM
need help in diff command : ali560045 Shell Programming and Scripting 5 05-26-2008 09:22 AM
diff command Vichu Shell Programming and Scripting 1 04-28-2008 07:06 AM
Need help with Scripting diff command tlfletcher05 Shell Programming and Scripting 2 01-26-2008 02:19 AM
Diff command problem gvsreddy_539 Shell Programming and Scripting 4 09-30-2007 08:36 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
  #1 (permalink)  
Old 02-26-2004
gilead29 gilead29 is offline
Registered User
  
 

Join Date: Feb 2004
Posts: 4
diff command

Hi,

I have 2 files i would like to have a DIFF command:

1.Marks differences between files
or
2.Mentions just the differences



Thanks
  #2 (permalink)  
Old 02-26-2004
druuna
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
.....

Last edited by druuna; 05-21-2009 at 09:14 AM..
  #3 (permalink)  
Old 02-26-2004
w33man w33man is offline
Registered User
  
 

Join Date: Sep 2003
Posts: 20
If dir1 is a directory
containing a directory named x,
and dir2 is a directory
containing a directory named x,
dir1/x and dir2/x both contain files named date.out,
and
dir2/x contains a file named y,

the command:
example% diff -r dir1 dir2
could produce output similar to:

Common subdirectories: dir1/x and dir2/x
Only in dir2/x: y
diff -r dir1/x/date.out dir2/x/date.out
1c1

Dont know if this helps more info in the man diff
  #4 (permalink)  
Old 03-08-2004
kduffin's Avatar
kduffin kduffin is offline Forum Advisor  
UN1X
  
 

Join Date: Nov 2003
Location: Maryland
Posts: 449
Another useful command is 'sdiff'. It displays the full contents of the files side by side, noting differences.

Cheers,

Keith
  #5 (permalink)  
Old 03-08-2004
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
Personally for more complicated diffs I prefer using a GUI program like kdiff3 with color-coding of different changed chunks, and you can use such kind of tools to merge conflicts very easily (and interactively).

P.S. Just for your information, I asked a related question on related diff command-line tools a couple of months earlier (though I eventually settled with GUI which I found from some obscure sources, and that seems to fit my needs really well):
Interactive patching?
  #6 (permalink)  
Old 03-09-2004
gilead29 gilead29 is offline
Registered User
  
 

Join Date: Feb 2004
Posts: 4
comparing two files

Hello All,

I thank you for your help but still i didn't succeed in comparing two files and recieving a new file which contains just the diffrences between the two.

I need it badly with my everyday work.

thanks,
Irit
  #7 (permalink)  
Old 03-09-2004
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
First produce a diff of two files, say file1 is the old copy, file2 is the newer copy.

diff file1 file2 > delta.diff

Then you can apply the diff to file1 by using the patch command:

patch -p0 < delta.diff file1
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:44 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0