Display binary value as hex

Display binary value as hex

Use od -bc

  • od: object dump
  • -b = similar to -t o1, = similar to --format=o1.  o1 type mean octal type, 1 bytes per integer.
  • -c = -t c: printable character or backslash escape

Example:

print "%s" "${IFS}" | od -bc

Result

0000000 040 011 012 000
             \t  \n  \0
0000004
Buy Me A Coffee