Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: diff & comm, helpful utils< Next Oldest | Next Newest >
clivesay Offline





Group: Guests
Posts: 935
Joined: Dec. 2003
Posted: Jan. 15 2005,02:21 QUOTE

bookmark

A while back someone enlightened me to the "diff" command. This allows you to compare the text in two files and output the differences between the two. I used it to build a .dsl with self extracting deb files  by taking a snapshot of the filesystem before the extraction and then a snapshot afterwards to view the differences.

Example:
Code Sample
diff b4.txt aft.txt > change.txt


This has been a handy utility for many different things.

Well, tonight I learned about the opposite command called "comm". This command compares two files and lists the files that are common between the two. This was helpful as I was building a .dsl with gtk2 files and I wanted to purge the files in my new .dsl that already contained files in the gtk2.dsl.

Example:
Code Sample
comm gtk2.txt emel.txt > same.txt


Both of these commands have different options you can see by typing diff --help and comm --help respectively.

I hope these help someone. I learn something new every single day.

Chris
Back to top
Profile PM MSN YIM 
cbagger01 Offline





Group: Members
Posts: 4264
Joined: Oct. 2003
Posted: Jan. 15 2005,20:36 QUOTE

Hm...

I've been a big fan of diff when I was using the VMS operating system.  Never knew about comm though.  Thanks for the tip.  I'm sure it will come in handy someday.
Back to top
Profile PM 
petergunn Offline





Group: Members
Posts: 40
Joined: Nov. 2004
Posted: Jan. 19 2005,20:21 QUOTE

vimdiff makes it much more obviosu what has changed between the two files over the regular diff...

vimdiff <file1> <file2>

give it a whirl :-)
Back to top
Profile PM 
2 replies since Jan. 15 2005,02:21 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: diff & comm

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code