?
Solved

How To Compare File Contents of Two Files Residing On Different Hosts

Posted on 2003-11-04
6
Medium Priority
?
832 Views
Last Modified: 2013-12-27
What is the most efficient way to compare the contents of two files residing on two different hosts? I need something I can build into a script.

HP-UX has a great utility for doing this, but I've not found an analog in Solaris 8.

Thanks!
0
Comment
Question by:pdouglas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 24

Expert Comment

by:shivsa
ID: 9682369
diff/sdiff  : if u want to compare 2 text file( this may be code or simple text files).
cksum: write file checksums and sizes, u get cksum for files and can comapre cksums.

if u just want to compare contents of file i would say go with diff.

0
 
LVL 24

Expert Comment

by:shivsa
ID: 9682386
if u want to use it in script, please check this answer.
i think u are looking for it.
http://www.experts-exchange.com/Operating_Systems/Solaris/Q_20647679.html

thanks,
Shiv
0
 
LVL 24

Accepted Solution

by:
shivsa earned 800 total points
ID: 9682415
there is one more command on solaris called cmp.
try man cmp.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 21

Expert Comment

by:tfewster
ID: 9683181
What do you use under HP-UX? I'm not aware of any proprietary utilities for that sort of task....Tho' I'd normally argue that HP kit & HP-UX are superior to Sun/Solaris ;-)

Are you thinking about rdist/rsync?
0
 

Author Comment

by:pdouglas
ID: 9686701
tfewster,

Yes. I believe it was rdist that I used under HP-UX 10.20. It was very useful, provided you're careful. It can bite you if you're not.


shivsa,

Thanks for your input!

And cheers to all! You folks really are top notch.
0
 
LVL 21

Expert Comment

by:tfewster
ID: 9690979
rdist comes with Solaris (it's pretty standard) and if you've already taken the trouble to learn how to use it safely, all your scripts/knowledge should be portable;  It's quite efficient too - Saving you from having to do a manual compare and _then_ update the file that is out of sync. On the other hand, if you just need a comparison of files visible from a single host (e.g. on local & NFS mounted filesystems), shivsa's suggestions are simpler & safer.

rsync isn't part of the base HP-UX or Solaris, but is available for both and is supposed to be more efficient & secure - though opinion is divided on which is "better"
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question