echo -n "Hello" | od -A n -t x1
Explanation:
- The
echoprogram will provide the string to the next command. - The
-nflag tells echo to not generate a new line at the end of the “Hello”. - The
odprogram is the “octal dump” program. (We will be providing a flag to tell it to dump it in hexadecimal instead of octal.) - The
-A nflag is short for--address-radix=n, with n being short for “none”. Without this part, the command would output an ugly numerical address prefix on the left side. This is useful for large dumps, but for a short string it is unnecessary. - The
-t x1flag is short for--format=x1, with the x being short for “hexadecimal” and the 1 meaning 1 byte.