Multiple choice technology operating systems

Write a command to display a file’s contents in various formats?

  1. oc -db file_name

  2. oc -cdh filename

  3. od -cbo file_name

  4. od -cbd file_name

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

od (octal dump) displays file contents in various formats. -c shows ASCII characters, -b shows bytes in octal, -d shows as 16-bit integers. 'od -cbd file_name' combines: -c (ASCII), -b (octal bytes), -d (decimal words). Options A and C use 'oc' which is not od, and B uses incorrect format -cdh. The correct command is od with proper format flags.