- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: cmp command !!!
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 10:56 AM
01-23-2006 10:56 AM
i wish compare both files, the file restored and file living in the path.
How can i compare them?
can i use diff command?
can i use cmp command?
How can i use cmp command ?
Thanks, Manuales.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 11:23 AM
01-23-2006 11:23 AM
SolutionI know for ascii files you can use the diff command.
For an alternative.
http://www.thefreecountry.com/programming/filecomparison.shtml
The diff command may have a binary switch, but I can't remember right now. See the man page for my memory gap.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 11:26 AM
01-23-2006 11:26 AM
Re: cmp command !!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 11:42 AM
01-23-2006 11:42 AM
Re: cmp command !!!
As Clay noted, a definitive file comparison test is the 'cksum' command. You can compare binary or ASCII files in this manner.
Compare the checksums of the files in the corresponding directories to determine if the contents of two directories are the same.
Blocks are be allocated to a directory as files are added, but the blocks are not returned when files are deleted. Thus you will often see a replicated directory's size smaller than its source directory. This is of no concern if the checksums of the *contents* of the two directories match.
'diff' and 'bdiff' can examine directories recursively, if both arguments are directories. 'diff' then sorts the contents of the directories by name, and runs on *text* files that have the same name in each directory.
See the manpages for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 11:58 AM
01-23-2006 11:58 AM
Re: cmp command !!!
I should not have suggested that 'diff' will not compare binary files. It will. Instead of reporting the differences as it does with ASCII files, it will report, for example:
"Binary files /tmp/file1 and /tmp/file2 differ"
Using 'cksum' one can compare the computed value of the two files for equality.
/No_Points Please For This Clarification/
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 12:33 PM
01-23-2006 12:33 PM
Re: cmp command !!!
Check with cksum, it gives best result, to check and compare two file. The checksum value should be same for both the case.
furthre # man cksum
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 04:28 PM
01-23-2006 04:28 PM
Re: cmp command !!!
Try to use cksum command to get difference.
cksum file1 file2
will give the details.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2006 04:34 PM
01-23-2006 04:34 PM
Re: cmp command !!!
You can use "cksum" suggested by unix gurus here. As well, if you want to have a try with something else, look at md5cksum.
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=md5checksum
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 03:56 AM
01-24-2006 03:56 AM
Re: cmp command !!!
# cksum log_g13m1.dbf log_g13m1.dbf.back
2219005271 52429824 log_g13m1.dbf
3688632956 52429824 log_g13m1.dbf.back
my doubt now is:
what is the meanning of first and second field?
Manuales.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 03:59 AM
01-24-2006 03:59 AM
Re: cmp command !!!
First field is the check sum value and second field is size of the file.
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 03:59 AM
01-24-2006 03:59 AM
Re: cmp command !!!
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 04:20 AM
01-24-2006 04:20 AM