LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-21-2010, 06:08 PM   #1
mattseanbachman
Member
 
Registered: Feb 2010
Posts: 40

Rep: Reputation: 15
Hexdump: inaccurate output?


This is simple enough to explain, simply look at the following and see if you notice anything fishy:

Code:
toor@toor:~/Desktop/test$ hexdump test
0000000 6464 740a 0a74                         
0000006
toor@toor:~/Desktop/test$ hexdump -C test
00000000  64 64 0a 74 74 0a                                 |dd.tt.|
00000006
It's a simple text file, two "d" characters, a newline, and two "t" characters, and another line break. Why the heck would the first invocation of hexdump appear to place things like "ddt(newline)(newline)t"?
 
Old 04-21-2010, 06:19 PM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
In the first invocation, the input has been read as 16bit integer words. The first character read is in the most significant byte and the second character is in the least significant byte.
In the second invocation, the input has been read as 8bit characters, as you would expect.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I use hexdump to display ASCII control codes? Akabaka Linux - Software 2 09-19-2009 06:52 PM
possible inaccurate tutorial fleshm LQ Suggestions & Feedback 3 06-27-2009 05:47 AM
hexdump vs od sulekha Linux - General 1 01-12-2009 03:35 PM
df reporting inaccurate imraven Linux - Software 2 03-26-2007 08:54 PM
Weather Report applet is clearly inaccurate newbiesforever MEPIS 11 09-16-2006 07:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration