- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Compare contents of two files
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-26-2006 06:48 AM
01-26-2006 06:48 AM
What is the command to compare contents of two files,
example:
I need compare two kernels.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 06:49 AM
01-26-2006 06:49 AM
Re: Compare contents of two files
as in "cmp file1 file2"
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 06:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 07:01 AM
01-26-2006 07:01 AM
Re: Compare contents of two files
use
diff
if you wanted to know if they are one and same, then use
cksum - if both has similar output numbers the files are identical
Chan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 07:04 AM
01-26-2006 07:04 AM
Re: Compare contents of two files
While 'diff' and 'cmp' will compare and optionally report the differences of ASSCII text files, all that will be returned for binary files is whether they differ or not.
If two binary files differ, 'diff' will simply note:
"Binary files f1 and f2 differ"
The best way to valid the "sameness" of any two files is to compare their 'cksum' value:
# cksum /stand/vmunix
2335558063 10340004 /stand/vmunix
The first number is the computed cksum; teh second is the number of octets.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 07:12 AM
01-26-2006 07:12 AM
Re: Compare contents of two files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 07:32 AM
01-26-2006 07:32 AM
Re: Compare contents of two files
I need compare the output of kmtune and to know as they are the differences.
Then aplly the changes...
MC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 08:01 AM
01-26-2006 08:01 AM
Re: Compare contents of two files
Try the following command..
#cmp file1_nmae file2_name
cheers
indrajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 08:02 AM
01-26-2006 08:02 AM
Re: Compare contents of two files
On each server, do:
# kmtune -l > /tmp/kmtune.$(hostnmae)
Then:
# diff -bC1 /tmp/kmtune.host1 /tmp/kmtune.host2
...to show lines in context...or simply:
# diff /tmp/kmtune.host1 /tmp/kmtune.host2
See the manpages for 'diff' for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 08:03 AM
01-26-2006 08:03 AM
Re: Compare contents of two files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 01:05 PM
01-26-2006 01:05 PM
Re: Compare contents of two files
#diff file1 file2
tienna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 05:52 PM
01-26-2006 05:52 PM
Re: Compare contents of two files
nm /stand/vmunix > /tmp/kernel1.symbol
nm
diff /tmp/kernel1.symbol /tmp/kernel2.symbol
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 05:56 PM
01-26-2006 05:56 PM
Re: Compare contents of two files
strings /stand/vmunix > /tmp/kernel1
strings
diff /tmp/kernel1 /tmp/kernel2
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2006 07:19 PM
01-26-2006 07:19 PM
Re: Compare contents of two files
cmp and diff would be a solution for you
cmp file1 file2
diff file1 file2
Good Luck,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2006 05:33 AM
01-27-2006 05:33 AM
Re: Compare contents of two files
MC