LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 07: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, 07:19 PM   #2
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,434

Rep: Reputation: 1354Reputation: 1354Reputation: 1354Reputation: 1354Reputation: 1354Reputation: 1354Reputation: 1354Reputation: 1354Reputation: 1354Reputation: 1354
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07:52 PM
possible inaccurate tutorial fleshm LQ Suggestions & Feedback 3 06-27-2009 06:47 AM
hexdump vs od sulekha Linux - General 1 01-12-2009 04:35 PM
df reporting inaccurate imraven Linux - Software 2 03-26-2007 09:54 PM
Weather Report applet is clearly inaccurate newbiesforever MEPIS 11 09-16-2006 08:45 AM


All times are GMT -5. The time now is 01:25 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration