Difficulty: Easy
Correct Answer: od
Explanation:
Introduction / Context:
System administrators and developers often need to inspect the raw bytes of a file. Unix provides a small, powerful tool to dump file contents in octal (and other bases). Recognizing the correct utility is fundamental to troubleshooting encodings, control characters, and binary formats.
Given Data / Assumptions:
Concept / Approach:
The command od (octal dump) is the standard utility for displaying file contents in octal by default. It can also show hexadecimal, ASCII, and other formats by providing options such as -t x1 for hex bytes or -An for suppressing addresses. It is ideal for spotting unprintable characters, line endings, and subtle binary differences.
Step-by-Step Solution:
Verification / Alternative check:
Compare od output with other tools such as hexdump or xxd where available. For octal-only needs, od’s default behavior is sufficient. Cross-check suspicious bytes by isolating a region with options like -j (skip) and -N (length).
Why Other Options Are Wrong:
Common Pitfalls:
Assuming od only supports octal (it supports multiple formats), misreading addresses versus data, and forgetting to use options to suppress addresses or choose a display type suitable for the task.
Final Answer:
od
Discussion & Comments