Does hexdump respect the endianness of its system?lspci machine-readable format (-vmm) does not show a kernel...

What are the IPSE’s, the ASPE’s, the FRIPSE’s and the GRIPSE’s?

Billiard balls collision

What happened to the HDEV ISS Experiment? Is it over?

Why error propagation in CBC mode encryption affect two blocks?

Why does Windows store Wi-Fi passwords in a reversible format?

Why is strlen so complex in C?

50-move rule: only the last 50 or any consecutive 50?

Expanding powers of expressions of the form ax+b

Unlock your Lock

Can I renew my USA passport book and passport card separately?

Open subspaces of CW complexes

To what extent should we fear giving offense?

Did anybody find out it was Anakin who blew up the command center?

Shift lens vs move body?

Contours of a national emergency in the United States

Discussing work with supervisor in an invited dinner with his family

Beginner to guitar playing - where should I begin?

Why is "dyadic" the only word with the prefix "dy-"?

Papers on arXiv solving the same problem at the same time

Weird corners with cline

How long do you think advanced cybernetic implants would plausibly last?

Anthropomorphic animals in romantic relationships with other species

LINQ for generating all possible permutations

Which old Technic set included large yellow motor?



Does hexdump respect the endianness of its system?


lspci machine-readable format (-vmm) does not show a kernel Module/Driver lineWhat does `*` mean using hexdump -C?Ubuntu runuser command?Commands for data manipulation of binary to octave/hex formats?Strange ascii from hexdump of text filePrint one byte signed number with hexdumpHexdump format syntax - colorHow to get Hexdump output in same format as hexedit?Do my LUKS partition damaged?Why does hexdump try to read through EOF?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







23















On my machine I get the following output when I run these commands:



$ echo foos > myfile
$ hexdump myfile
6f66 736f 000a


The output from hexdump is little-endian. Does this mean that my machine is little-endian, or does hexdump always use little-endian format?










share|improve this question

































    23















    On my machine I get the following output when I run these commands:



    $ echo foos > myfile
    $ hexdump myfile
    6f66 736f 000a


    The output from hexdump is little-endian. Does this mean that my machine is little-endian, or does hexdump always use little-endian format?










    share|improve this question





























      23












      23








      23


      5






      On my machine I get the following output when I run these commands:



      $ echo foos > myfile
      $ hexdump myfile
      6f66 736f 000a


      The output from hexdump is little-endian. Does this mean that my machine is little-endian, or does hexdump always use little-endian format?










      share|improve this question
















      On my machine I get the following output when I run these commands:



      $ echo foos > myfile
      $ hexdump myfile
      6f66 736f 000a


      The output from hexdump is little-endian. Does this mean that my machine is little-endian, or does hexdump always use little-endian format?







      utilities bsd hexdump






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 27 '14 at 17:10









      jw013

      38.4k7 gold badges107 silver badges127 bronze badges




      38.4k7 gold badges107 silver badges127 bronze badges










      asked Nov 14 '12 at 23:48









      Cory KleinCory Klein

      5,97222 gold badges62 silver badges85 bronze badges




      5,97222 gold badges62 silver badges85 bronze badges

























          2 Answers
          2






          active

          oldest

          votes


















          30















          The traditional BSD hexdump utility uses the platform's endianness, so the output you see means your machine is little-endian.



          Use hexdump -C (or od -t x1) to get consistent byte-by-byte output irrespective of the platform's endianness.






          share|improve this answer



































            5















            From the manpage:



             -x      Two-byte hexadecimal display.  Display the input offset in hexa‐
            decimal, followed by eight, space separated, four column, zero-
            filled, two-byte quantities of input data, in hexadecimal, per
            line.


            ...



             If no format strings are specified, the default display is equivalent to
            specifying the -x option.


            Your output is little-endian (least significant byte first), which is also the endianness of the x86 and x86_64 architectures, which you are probably using.






            share|improve this answer























            • 3





              Is it just me, or does the man page not mention anywhere that it is treating the "two-byte quantities" as integers? I thought I was taking crazy pills...

              – slashingweapon
              Jun 14 '17 at 21:41











            • @slashingweapon "two-byte quantity of input data" is uint16_t integer.

              – Ruslan
              May 8 '18 at 7:53













            • "Two bytes" is not the same as uint16_t on a little-endian system.

              – slashingweapon
              May 10 '18 at 16:43














            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f55770%2fdoes-hexdump-respect-the-endianness-of-its-system%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            30















            The traditional BSD hexdump utility uses the platform's endianness, so the output you see means your machine is little-endian.



            Use hexdump -C (or od -t x1) to get consistent byte-by-byte output irrespective of the platform's endianness.






            share|improve this answer
































              30















              The traditional BSD hexdump utility uses the platform's endianness, so the output you see means your machine is little-endian.



              Use hexdump -C (or od -t x1) to get consistent byte-by-byte output irrespective of the platform's endianness.






              share|improve this answer






























                30














                30










                30









                The traditional BSD hexdump utility uses the platform's endianness, so the output you see means your machine is little-endian.



                Use hexdump -C (or od -t x1) to get consistent byte-by-byte output irrespective of the platform's endianness.






                share|improve this answer















                The traditional BSD hexdump utility uses the platform's endianness, so the output you see means your machine is little-endian.



                Use hexdump -C (or od -t x1) to get consistent byte-by-byte output irrespective of the platform's endianness.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 2 hours ago









                Cory Klein

                5,97222 gold badges62 silver badges85 bronze badges




                5,97222 gold badges62 silver badges85 bronze badges










                answered Nov 14 '12 at 23:55









                GillesGilles

                571k138 gold badges1180 silver badges1692 bronze badges




                571k138 gold badges1180 silver badges1692 bronze badges




























                    5















                    From the manpage:



                     -x      Two-byte hexadecimal display.  Display the input offset in hexa‐
                    decimal, followed by eight, space separated, four column, zero-
                    filled, two-byte quantities of input data, in hexadecimal, per
                    line.


                    ...



                     If no format strings are specified, the default display is equivalent to
                    specifying the -x option.


                    Your output is little-endian (least significant byte first), which is also the endianness of the x86 and x86_64 architectures, which you are probably using.






                    share|improve this answer























                    • 3





                      Is it just me, or does the man page not mention anywhere that it is treating the "two-byte quantities" as integers? I thought I was taking crazy pills...

                      – slashingweapon
                      Jun 14 '17 at 21:41











                    • @slashingweapon "two-byte quantity of input data" is uint16_t integer.

                      – Ruslan
                      May 8 '18 at 7:53













                    • "Two bytes" is not the same as uint16_t on a little-endian system.

                      – slashingweapon
                      May 10 '18 at 16:43
















                    5















                    From the manpage:



                     -x      Two-byte hexadecimal display.  Display the input offset in hexa‐
                    decimal, followed by eight, space separated, four column, zero-
                    filled, two-byte quantities of input data, in hexadecimal, per
                    line.


                    ...



                     If no format strings are specified, the default display is equivalent to
                    specifying the -x option.


                    Your output is little-endian (least significant byte first), which is also the endianness of the x86 and x86_64 architectures, which you are probably using.






                    share|improve this answer























                    • 3





                      Is it just me, or does the man page not mention anywhere that it is treating the "two-byte quantities" as integers? I thought I was taking crazy pills...

                      – slashingweapon
                      Jun 14 '17 at 21:41











                    • @slashingweapon "two-byte quantity of input data" is uint16_t integer.

                      – Ruslan
                      May 8 '18 at 7:53













                    • "Two bytes" is not the same as uint16_t on a little-endian system.

                      – slashingweapon
                      May 10 '18 at 16:43














                    5














                    5










                    5









                    From the manpage:



                     -x      Two-byte hexadecimal display.  Display the input offset in hexa‐
                    decimal, followed by eight, space separated, four column, zero-
                    filled, two-byte quantities of input data, in hexadecimal, per
                    line.


                    ...



                     If no format strings are specified, the default display is equivalent to
                    specifying the -x option.


                    Your output is little-endian (least significant byte first), which is also the endianness of the x86 and x86_64 architectures, which you are probably using.






                    share|improve this answer















                    From the manpage:



                     -x      Two-byte hexadecimal display.  Display the input offset in hexa‐
                    decimal, followed by eight, space separated, four column, zero-
                    filled, two-byte quantities of input data, in hexadecimal, per
                    line.


                    ...



                     If no format strings are specified, the default display is equivalent to
                    specifying the -x option.


                    Your output is little-endian (least significant byte first), which is also the endianness of the x86 and x86_64 architectures, which you are probably using.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Jan 30 at 22:46









                    Cory Klein

                    5,97222 gold badges62 silver badges85 bronze badges




                    5,97222 gold badges62 silver badges85 bronze badges










                    answered Nov 14 '12 at 23:54









                    Dennis KaarsemakerDennis Kaarsemaker

                    7,2831 gold badge23 silver badges26 bronze badges




                    7,2831 gold badge23 silver badges26 bronze badges











                    • 3





                      Is it just me, or does the man page not mention anywhere that it is treating the "two-byte quantities" as integers? I thought I was taking crazy pills...

                      – slashingweapon
                      Jun 14 '17 at 21:41











                    • @slashingweapon "two-byte quantity of input data" is uint16_t integer.

                      – Ruslan
                      May 8 '18 at 7:53













                    • "Two bytes" is not the same as uint16_t on a little-endian system.

                      – slashingweapon
                      May 10 '18 at 16:43














                    • 3





                      Is it just me, or does the man page not mention anywhere that it is treating the "two-byte quantities" as integers? I thought I was taking crazy pills...

                      – slashingweapon
                      Jun 14 '17 at 21:41











                    • @slashingweapon "two-byte quantity of input data" is uint16_t integer.

                      – Ruslan
                      May 8 '18 at 7:53













                    • "Two bytes" is not the same as uint16_t on a little-endian system.

                      – slashingweapon
                      May 10 '18 at 16:43








                    3




                    3





                    Is it just me, or does the man page not mention anywhere that it is treating the "two-byte quantities" as integers? I thought I was taking crazy pills...

                    – slashingweapon
                    Jun 14 '17 at 21:41





                    Is it just me, or does the man page not mention anywhere that it is treating the "two-byte quantities" as integers? I thought I was taking crazy pills...

                    – slashingweapon
                    Jun 14 '17 at 21:41













                    @slashingweapon "two-byte quantity of input data" is uint16_t integer.

                    – Ruslan
                    May 8 '18 at 7:53







                    @slashingweapon "two-byte quantity of input data" is uint16_t integer.

                    – Ruslan
                    May 8 '18 at 7:53















                    "Two bytes" is not the same as uint16_t on a little-endian system.

                    – slashingweapon
                    May 10 '18 at 16:43





                    "Two bytes" is not the same as uint16_t on a little-endian system.

                    – slashingweapon
                    May 10 '18 at 16:43


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f55770%2fdoes-hexdump-respect-the-endianness-of-its-system%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                    Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                    Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...