clivesay
Group: Guests
Posts: 935
Joined: Dec. 2003 |
|
Posted: Jan. 15 2005,02:21 |
|
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
|