Inspect each byte of sample.bin as hexadecimal.
Omit the address column and use one-byte hexadecimal values.
Which GNU od command is appropriate?
od -An -tx1 suppresses addresses and formats the input as one-byte hexadecimal values.
Detailed explanation
od -An -tx1 sample.binCorrect. -An omits the address field and -tx1 prints one-byte hexadecimal values.
od -tc sample.binIncorrect. -tc requests character output rather than hexadecimal bytes.
cat sample.binIncorrect. cat sends raw bytes to the terminal without formatting them.
wc -c sample.binIncorrect. wc -c counts bytes but does not display each byte value.
Try it yourself
An example you can run in a temporary verification environment.
printf 'AB' | od -An -tx1Expected result
41 42Key points
- od dumps byte representations
- -An suppresses addresses
- -tx1 formats hexadecimal bytes
Notes
- Environment: GNU coreutils 9.x / 標準入力
- Use small, disposable text streams when testing filters.
- Locale, encoding, and GNU/POSIX implementation details can affect edge cases.
Foundation review
Place the operation
A byte-oriented hexadecimal dump exposes exact values that text rendering can hide.
Check the side effect
Use a short disposable file and compare the dump with its known byte values.