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.
Correct. -An omits the address field and -tx1 prints one-byte hexadecimal values.
od -tc sample.binIncorrect. -tc requests character output rather than hexadecimal bytes.
Incorrect. -tc requests character output rather than hexadecimal bytes.
cat sample.binIncorrect. cat sends raw bytes to the terminal without formatting them.
Incorrect. 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.
Incorrect. 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 / 標準入力
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.