KDOC 73: odでファイルの中身をN進数で見る
この文書のステータス
- 作成
- 2024-02-07 貴島
- レビュー
- 2024-02-08 貴島
概要
od
コマンドは、バイナリファイルを8進数や16進数で表示するコマンド。実際にどう保存されているか理解するのに役立つ。
使い方
ユースケースを示す。
od README.md
| 0 | 20533 | 72133 | 74145 | 66164 | 67151 | 56564 | 64050 | 72164 | | 20 | 71560 | 27472 | 63457 | 72151 | 72550 | 27142 | 67543 | 27555 | | 40 | 64553 | 64552 | 60555 | 27504 | 67562 | 66541 | 60457 | 72143 | | 60 | 67551 | 71556 | 73457 | 71157 | 63153 | 67554 | 71567 | 66057 | | 100 | 67151 | 27164 | 66571 | 27554 | 60542 | 63544 | 27145 | 73163 | | 120 | 24547 | 24135 | 72150 | 70164 | 35163 | 27457 | 64547 | 64164 | | 140 | 61165 | 61456 | 66557 | 65457 | 65151 | 66551 | 42141 | 71057 | | 160 | 60557 | 27555 | 61541 | 64564 | 67157 | 27563 | 67567 | 65562 | | 200 | 66146 | 73557 | 27563 | 64554 | 72156 | 74456 | 66155 | 5051 | | 220 | 20533 | 50133 | 61165 | 64554 | 64163 | 72040 | 20157 | 64507 | | 240 | 44164 | 61165 | 50040 | 63541 | 71545 | 24135 | 72150 | 70164 | | 260 | 35163 | 27457 | 64547 | 64164 | 61165 | 61456 | 66557 | 65457 | | 300 | 65151 | 66551 | 42141 | 71057 | 60557 | 27555 | 61541 | 64564 | | 320 | 67157 | 27563 | 67567 | 65562 | 66146 | 73557 | 27563 | 72560 | | 340 | 66142 | 71551 | 27150 | 66571 | 27554 | 60542 | 63544 | 27145 | | 360 | 73163 | 24547 | 24135 | 72150 | 70164 | 35163 | 27457 | 64547 | | 400 | 64164 | 61165 | 61456 | 66557 | 65457 | 65151 | 66551 | 42141 | | 420 | 71057 | 60557 | 27555 | 61541 | 64564 | 67157 | 27563 | 67567 | | 440 | 65562 | 66146 | 73557 | 27563 | 72560 | 66142 | 71551 | 27150 | | 460 | 66571 | 24554 | 5012 | 64474 | 63555 | 71440 | 61562 | 21075 | | 500 | 72150 | 70164 | 35163 | 27457 | 71565 | 71145 | 64455 | 60555 | | 520 | 62547 | 27163 | 64547 | 64164 | 61165 | 71565 | 71145 | 67543 | | 540 | 72156 | 67145 | 27164 | 67543 | 27555 | 30461 | 34465 | 33465 | | 560 | 30071 | 30457 | 31071 | 31061 | 31066 | 30070 | 33455 | 33460 | | 600 | 61470 | 33462 | 26461 | 30144 | 60543 | 32055 | 33543 | 26542 | | 620 | 60471 | 34141 | 62455 | 32144 | 32545 | 32141 | 61542 | 61143 | | 640 | 27066 | 67160 | 21147 | 73440 | 62151 | 64164 | 21075 | 30064 | | 660 | 21045 | 60440 | 64554 | 67147 | 71075 | 63551 | 72150 | 5076 | | 700 | 21412 | 47440 | 63562 | 51040 | 60557 | 20155 | 67556 | 62564 | | 720 | 5163 | 26412 | 47040 | 72157 | 71545 | 61040 | 20171 | 66505 | | 740 | 61541 | 20163 | 60560 | 65543 | 63541 | 20145 | 71117 | 20147 | | 760 | 67522 | 66541 | 64040 | 72164 | 71560 | 27472 | 63457 | 72151 | | 1000 | 72550 | 27142 | 67543 | 27555 | 71157 | 26547 | 67562 | 66541 | | 1020 | 67457 | 63562 | 71055 | 60557 | 5155 | 25412 | 70040 | 67562 | | 1040 | 72544 | 72143 | 67551 | 35156 | 64040 | 72164 | 71560 | 27472 | | 1060 | 65457 | 65151 | 66551 | 62141 | 63456 | 72151 | 72550 | 27142 | | 1100 | 67551 | 71057 | 60557 | 27555 | 25412 | 71440 | 60564 | 64547 | | 1120 | 63556 | 20072 | 72150 | 70164 | 35163 | 27457 | 67562 | 66541 | | 1140 | 71455 | 60564 | 64547 | 63556 | 64056 | 71145 | 65557 | 60565 | | 1160 | 70160 | 61456 | 66557 | 5057 | 20053 | 67555 | 64556 | 67564 | | 1200 | 35162 | 64040 | 72164 | 71560 | 27472 | 65457 | 65151 | 66551 | | 1220 | 62141 | 63456 | 72151 | 72550 | 27142 | 67551 | 71057 | 60557 | | 1240 | 57555 | 70165 | 72160 | 66551 | 27545 | 5012 | 21443 | 62040 | | 1260 | 73145 | 66145 | 70157 | 62555 | 72156 | 5012 | 60140 | 71540 | | 1300 | 62550 | 66154 | 66412 | 65541 | 20145 | 71157 | 31147 | 72150 | | 1320 | 66155 | 66412 | 65541 | 20145 | 62563 | 73162 | 71145 | 60012 | | 1340 | 60140 | 5012 | 67450 | 72160 | 67551 | 60556 | 24554 | 61440 | | 1360 | 70157 | 20171 | 64546 | 62554 | 5163 | 60140 | 71540 | 62550 | | 1400 | 66154 | 62012 | 61557 | 62553 | 20162 | 72562 | 20156 | 26455 | | 1420 | 62544 | 60564 | 64143 | 26440 | 67055 | 66541 | 20145 | 62562 | | 1440 | 62554 | 71541 | 20145 | 64147 | 71143 | 64456 | 27557 | 64553 | | 1460 | 64552 | 60555 | 27544 | 67562 | 66541 | 71137 | 66145 | 60545 | | 1500 | 62563 | 66072 | 72141 | 71545 | 20164 | 23046 | 56040 | 62012 | | 1520 | 61557 | 62553 | 20162 | 70143 | 71040 | 66145 | 60545 | 62563 | | 1540 | 27472 | 67562 | 66541 | 70057 | 61165 | 64554 | 20143 | 20056 | | 1560 | 23046 | 56040 | 71412 | 62165 | 20157 | 64143 | 73557 | 20156 | | 1600 | 51055 | 22040 | 51525 | 51105 | 22072 | 51525 | 51105 | 27040 | | 1620 | 70057 | 61165 | 64554 | 5143 | 60140 | 5140 | | | | 1634 | | | | | | | | |
od -c README.md
| 0 | [ | ! | [ | t | e | x | t | l | i | n | t | ] | ( | h | t | t | | 20 | p | s | : | / | / | g | i | t | h | u | b | . | c | o | m | / | | 40 | k | i | j | i | m | a | D | / | r | o | a | m | / | a | c | t | | 60 | i | o | n | s | / | w | o | r | k | f | l | o | w | s | / | l | | 100 | i | n | t | . | y | m | l | / | b | a | d | g | e | . | s | v | | 120 | g | ) | ] | ( | h | t | t | p | s | : | / | / | g | i | t | h | | 140 | u | b | . | c | o | m | / | k | i | j | i | m | a | D | / | r | | 160 | o | a | m | / | a | c | t | i | o | n | s | / | w | o | r | k | | 200 | f | l | o | w | s | / | l | i | n | t | . | y | m | l | ) | \n | | 220 | [ | ! | [ | P | u | b | l | i | s | h | t | o | G | i | | | | 240 | t | H | u | b | P | a | g | e | s | ] | ( | h | t | t | p | | | 260 | s | : | / | / | g | i | t | h | u | b | . | c | o | m | / | k | | 300 | i | j | i | m | a | D | / | r | o | a | m | / | a | c | t | i | | 320 | o | n | s | / | w | o | r | k | f | l | o | w | s | / | p | u | | 340 | b | l | i | s | h | . | y | m | l | / | b | a | d | g | e | . | | 360 | s | v | g | ) | ] | ( | h | t | t | p | s | : | / | / | g | i | | 400 | t | h | u | b | . | c | o | m | / | k | i | j | i | m | a | D | | 420 | / | r | o | a | m | / | a | c | t | i | o | n | s | / | w | o | | 440 | r | k | f | l | o | w | s | / | p | u | b | l | i | s | h | . | | 460 | y | m | l | ) | \n | \n | < | i | m | g | s | r | c | = | " | | | 500 | h | t | t | p | s | : | / | / | u | s | e | r | - | i | m | a | | 520 | g | e | s | . | g | i | t | h | u | b | u | s | e | r | c | o | | 540 | n | t | e | n | t | . | c | o | m | / | 1 | 1 | 5 | 9 | 5 | 7 | | 560 | 9 | 0 | / | 1 | 9 | 2 | 1 | 2 | 6 | 2 | 8 | 0 | - | 7 | 0 | 7 | | 600 | 8 | c | 2 | 7 | 1 | - | d | 0 | c | a | - | 4 | c | 7 | b | - | | 620 | 9 | a | a | 8 | - | e | d | 4 | e | 5 | a | 4 | b | c | c | b | | 640 | 6 | . | p | n | g | " | w | i | d | t | h | = | " | 4 | 0 | | | 660 | % | " | a | l | i | g | n | = | r | i | g | h | t | > | \n | | | 700 | \n | # | O | r | g | R | o | a | m | n | o | t | e | | | | | 720 | s | \n | \n | - | N | o | t | e | s | b | y | E | m | | | | | 740 | a | c | s | p | a | c | k | a | g | e | O | r | g | | | | | 760 | R | o | a | m | h | t | t | p | s | : | / | / | g | i | t | | | 1000 | h | u | b | . | c | o | m | / | o | r | g | - | r | o | a | m | | 1020 | / | o | r | g | - | r | o | a | m | \n | \n | + | p | r | o | | | 1040 | d | u | c | t | i | o | n | : | h | t | t | p | s | : | / | | | 1060 | / | k | i | j | i | m | a | d | . | g | i | t | h | u | b | . | | 1100 | i | o | / | r | o | a | m | / | \n | + | s | t | a | g | i | | | 1120 | n | g | : | h | t | t | p | s | : | / | / | r | o | a | m | | | 1140 | - | s | t | a | g | i | n | g | . | h | e | r | o | k | u | a | | 1160 | p | p | . | c | o | m | / | \n | + | m | o | n | i | t | o | | | 1200 | r | : | h | t | t | p | s | : | / | / | k | i | j | i | m | | | 1220 | a | d | . | g | i | t | h | u | b | . | i | o | / | r | o | a | | 1240 | m | _ | u | p | p | t | i | m | e | / | \n | \n | # | # | d | | | 1260 | e | v | e | l | o | p | m | e | n | t | \n | \n | ` | ` | ` | s | | 1300 | h | e | l | l | \n | m | a | k | e | o | r | g | 2 | h | t | | | 1320 | m | l | \n | m | a | k | e | s | e | r | v | e | r | \n | ` | | | 1340 | ` | ` | \n | \n | ( | o | p | t | i | o | n | a | l | ) | c | | | 1360 | o | p | y | f | i | l | e | s | \n | ` | ` | ` | s | h | e | | | 1400 | l | l | \n | d | o | c | k | e | r | r | u | n | - | - | | | | 1420 | d | e | t | a | c | h | - | - | n | a | m | e | r | e | | | | 1440 | l | e | a | s | e | g | h | c | r | . | i | o | / | k | i | | | 1460 | j | i | m | a | d | / | r | o | a | m | _ | r | e | l | e | a | | 1500 | s | e | : | l | a | t | e | s | t | & | & | \ | \n | d | | | | 1520 | o | c | k | e | r | c | p | r | e | l | e | a | s | e | | | | 1540 | : | / | r | o | a | m | / | p | u | b | l | i | c | . | | | | 1560 | & | & | \ | \n | s | u | d | o | c | h | o | w | n | | | | | 1600 | - | R | $ | U | S | E | R | : | $ | U | S | E | R | . | | | | 1620 | / | p | u | b | l | i | c | \n | ` | ` | ` | \n | | | | | | 1634 | | | | | | | | | | | | | | | | |
関連
- KDOC 24: ゲームボーイエミュレータを作る。で、コンピュータがどうデータを保存し読み込むかに直面した