{
    "mode": "info",
    "parameter": "od",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/od/json",
    "generated": "2026-07-31T02:25:49Z",
    "sections": {
        "File: coreutils.info,  Node: od invocation,  Next: base32 invocation,  Prev: nl invocation,  Up: Output of entire files": {
            "content": "",
            "subsections": [
                {
                    "name": "3.4 'od': Write files in octal or other formats",
                    "content": "'od' writes an unambiguous representation of each FILE ('-' means\nstandard input), or standard input if none are given.  Synopses:\n\nod [OPTION]... [FILE]...\nod [-abcdfilosx]... [FILE] [[+]OFFSET[.][b]]\nod [OPTION]... --traditional [FILE] [[+]OFFSET[.][b] [[+]LABEL[.][b]]]\n\nEach line of output consists of the offset in the input, followed by\ngroups of data from the file.  By default, 'od' prints the offset in\noctal, and each group of file data is a C 'short int''s worth of input\nprinted as a single octal number.\n\nIf OFFSET is given, it specifies how many input bytes to skip before\nformatting and writing.  By default, it is interpreted as an octal\nnumber, but the optional trailing decimal point causes it to be\ninterpreted as decimal.  If no decimal is specified and the offset\nbegins with '0x' or '0X' it is interpreted as a hexadecimal number.  If\nthere is a trailing 'b', the number of bytes skipped will be OFFSET\nmultiplied by 512.\n\nIf a command is of both the first and second forms, the second form\nis assumed if the last operand begins with '+' or (if there are two\noperands) a digit.  For example, in 'od foo 10' and 'od +10' the '10' is\nan offset, whereas in 'od 10' the '10' is a file name.\n\nThe program accepts the following options.  Also see *note Common\noptions::.\n\n'-A RADIX'\n'--address-radix=RADIX'\nSelect the base in which file offsets are printed.  RADIX can be\none of the following:\n\n'd'\ndecimal;\n'o'\noctal;\n'x'\nhexadecimal;\n'n'\nnone (do not print offsets).\n\nThe default is octal.\n\n'--endian=ORDER'\nReorder input bytes, to handle inputs with differing byte orders,\nor to provide consistent output independent of the endian\nconvention of the current system.  Swapping is performed according\nto the specified '--type' size and endian ORDER, which can be\n'little' or 'big'.\n\n'-j BYTES'\n'--skip-bytes=BYTES'\nSkip BYTES input bytes before formatting and writing.  If BYTES\nbegins with '0x' or '0X', it is interpreted in hexadecimal;\notherwise, if it begins with '0', in octal; otherwise, in decimal.\nBYTES may be, or may be an integer optionally followed by, one of\nthe following multiplicative suffixes:\n'b'  =>            512 (\"blocks\")\n'KB' =>           1000 (KiloBytes)\n'K'  =>           1024 (KibiBytes)\n'MB' =>      1000*1000 (MegaBytes)\n'M'  =>      1024*1024 (MebiBytes)\n'GB' => 1000*1000*1000 (GigaBytes)\n'G'  => 1024*1024*1024 (GibiBytes)\nand so on for 'T', 'P', 'E', 'Z', and 'Y'.  Binary prefixes can be\nused, too: 'KiB'='K', 'MiB'='M', and so on.\n\n'-N BYTES'\n'--read-bytes=BYTES'\nOutput at most BYTES bytes of the input.  Prefixes and suffixes on\n'bytes' are interpreted as for the '-j' option.\n\n'-S BYTES'\n'--strings[=BYTES]'\nInstead of the normal output, output only \"string constants\": at\nleast BYTES consecutive ASCII graphic characters, followed by a\nzero byte (ASCII NUL). Prefixes and suffixes on BYTES are\ninterpreted as for the '-j' option.\n\nIf BYTES is omitted with '--strings', the default is 3.\n\n'-t TYPE'\n'--format=TYPE'\nSelect the format in which to output the file data.  TYPE is a\nstring of one or more of the below type indicator characters.  If\nyou include more than one type indicator character in a single TYPE\nstring, or use this option more than once, 'od' writes one copy of\neach output line using each of the data types that you specified,\nin the order that you specified.\n\nAdding a trailing \"z\" to any type specification appends a display\nof the single byte character representation of the printable\ncharacters to the output line generated by the type specification.\n\n'a'\nnamed character, ignoring high-order bit\n'c'\nprintable single byte character, C backslash escape or a 3\ndigit octal sequence\n'd'\nsigned decimal\n'f'\nfloating point (*note Floating point::)\n'o'\noctal\n'u'\nunsigned decimal\n'x'\nhexadecimal\n\nThe type 'a' outputs things like 'sp' for space, 'nl' for newline,\nand 'nul' for a zero byte.  Only the least significant seven bits\nof each byte is used; the high-order bit is ignored.  Type 'c'\noutputs ' ', '\\n', and '\\0', respectively.\n\nExcept for types 'a' and 'c', you can specify the number of bytes\nto use in interpreting each number in the given data type by\nfollowing the type indicator character with a decimal integer.\nAlternately, you can specify the size of one of the C compiler's\nbuilt-in data types by following the type indicator character with\none of the following characters.  For integers ('d', 'o', 'u',\n'x'):\n\n'C'\nchar\n'S'\nshort\n'I'\nint\n'L'\nlong\n\nFor floating point ('f'):\n\nF\nfloat\nD\ndouble\nL\nlong double\n\n'-v'\n'--output-duplicates'\nOutput consecutive lines that are identical.  By default, when two\nor more consecutive output lines would be identical, 'od' outputs\nonly the first line, and puts just an asterisk on the following\nline to indicate the elision.\n\n'-w[N]'\n'--width[=N]'\nDump 'n' input bytes per output line.  This must be a multiple of\nthe least common multiple of the sizes associated with the\nspecified output types.\n\nIf this option is not given at all, the default is 16.  If N is\nomitted, the default is 32.\n\nThe next several options are shorthands for format specifications.\nGNU 'od' accepts any combination of shorthands and format specification\noptions.  These options accumulate.\n\n'-a'\nOutput as named characters.  Equivalent to '-t a'.\n\n'-b'\nOutput as octal bytes.  Equivalent to '-t o1'.\n\n'-c'\nOutput as printable single byte characters, C backslash escapes or\n3 digit octal sequences.  Equivalent to '-t c'.\n\n'-d'\nOutput as unsigned decimal two-byte units.  Equivalent to '-t u2'.\n\n'-f'\nOutput as floats.  Equivalent to '-t fF'.\n\n'-i'\nOutput as decimal ints.  Equivalent to '-t dI'.\n\n'-l'\nOutput as decimal long ints.  Equivalent to '-t dL'.\n\n'-o'\nOutput as octal two-byte units.  Equivalent to '-t o2'.\n\n'-s'\nOutput as decimal two-byte units.  Equivalent to '-t d2'.\n\n'-x'\nOutput as hexadecimal two-byte units.  Equivalent to '-t x2'.\n\n'--traditional'\nRecognize the non-option label argument that traditional 'od'\naccepted.  The following syntax:\n\nod --traditional [FILE] [[+]OFFSET[.][b] [[+]LABEL[.][b]]]\n\ncan be used to specify at most one file and optional arguments\nspecifying an offset and a pseudo-start address, LABEL.  The LABEL\nargument is interpreted just like OFFSET, but it specifies an\ninitial pseudo-address.  The pseudo-addresses are displayed in\nparentheses following any normal address.\n\nAn exit status of zero indicates success, and a nonzero value\nindicates failure.\n"
                }
            ]
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}