xxd

XXD(1)                      General Commands Manual                     XXD(1)



åå
       xxd - 16 é²ãã³ããä½æããããåã«æ»ãããã

æ¸å¼
       xxd -h[elp]
       xxd [options] [infile [outfile]]
       xxd -r[evert] [options] [infile [outfile]]

説æ
       ãã¡ã¤ã«ãæ¨æºå¥åãã 16 é²ãã³ããä½æãã¾ãã 16
       é²ãã³ãããåã®ãã¤ããªã«æ»ããã¨ãã§ãã¾ãã uuencode(1) ã uudecode(1)
       ã®ããã«ããã¤ããªãã¼ã¿ããã¡ã¼ã«ã«è²¼ãä»ãå¯è½ãª ASCII å½¢å¼ã«å¤æã§ãã
       ããæ¨æºåºåã«åºåãããã¨ãã§ãã¾ãã
       ããã«ããã¤ããªãã¡ã¤ã«ã«ããããå½ã¦ãã¨ãã使ãæ¹ãã§ãã¾ãã

ãªãã·ã§ã³
       infile ãæå®ããªãã£ãå ´åã¯ãæ¨æºå¥åãèªã¿è¾¼ã¾ãã¾ãã infile ã« `-'
       ãæå®ããå ´åããæ¨æºå¥åããèªã¿è¾¼ã¾ãã¾ãã outfile ãæå®ããªãã£ã (ã¾ã㯠`-'
       ãæå®ãã) å ´åã¯ãæ¨æºåºåã«åºåããã¾ãã

       å¼æ°ã®è§£éå¦çã¯é©å½ãªã®ã§æ³¨æãã¦ãã ããããã©ã¡ã¼ã¿ãåããªãå¼æ°ã¯ æåã®ä¸æå‐
       ã ããã§ãã¯ããã¾ãã å¼æ°ã®æåã¨ãã©ã¡ã¼ã¿ã®éã®ã¹ãã¼ã¹ã¯çç¥å¯è½ã§ãã
       ãã©ã¡ã¼ã¿ã¯ 10 é²æ°ã16 é²æ°ã8 é²æ°ã§æå®ã§ãã¾ãã -c8 ã -c 8 ã -c 010 ã
       -cols 8 ã¯ãã¹ã¦åãæå³ã§ãã

       -a | -autoskip
              ãªã¼ãã¹ããã: é£ç¶ãã nul è¡ãä¸ã¤ã® '*' ã§ç½®ãæããã

       -b | -bits
              ããã (2é²æ°) ãã³ãã 1 ãªã¯ãããã "1" 㨠"0" ã® 8 æåã§åºåããã¾ãã
              åè¡ã®è¡é ã«ã¯ 16 é²æ°ã®è¡çªå·ã表示ããã¾ãã è¡æ«ã«ã¯ ascii (ã¾ãã¯
              ebcdic) ã§è¡¨ããå ´åã®æåã表示ããã¾ãã ãã®ã¢ã¼ãã§ã¯ -rã-pã-i
              ã¯æ©è½ãã¾ããã

       -c cols | -cols cols
              ä¸è¡ <cols> ãªã¯ãããã§åºåãããæ¨æºè¨å®ã¯ 16 (-i: 12, -ps: 30, -b:
              6)ãæ大 256ã

       -E | -EBCDIC
              å³ç«¯ã«åºåãããæåã®ã¨ã³ã³ã¼ãã£ã³ã°ã ASCII ãã EBCDIC ã«å¤æ´ããã 16
              é²ãã³ãã®åºåå½¢å¼ã¯å¤æ´ããã¾ããã -rã-pã-i
              ãåæã«æå®ãããå ´åã¯ä½ã®å¹æãããã¾ããã

       -g bytes | -groupsize bytes
              åºåã <bytes> ãã¤ã (2 æåã® 16 é²æ°ãã¾ã㯠8 æåã® 2 é²æ°)
              ãã¨ã«ã¹ãã¼ã¹ã§åºåãã¾ ãã åºåããã«åºåããã«ã¯ -g 0 ãæå®ãã¦ãã ããã
              <Bytes> ã®æ¨æºè¨å®ã¯ 2 ã§ãã2 é²ãã³ãã®å ´å㯠1 ã§ãã
              ãã¹ãã¹ã¯ãªããå½¢å¼ãã¤ã³ã¯ã«ã¼ãå½¢å¼ã§åºåããã¨ãã¯ããã®ãªãã·ã§ã³ã¯ä½¿ã
              ãã¾ããã

       -h | -help
              ã³ãã³ãã®èª¬æãåºåãã¦çµäºãããå¤æã¯å®è¡ããã¾ããã

       -i | -include
              C ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«å½¢å¼ã§åºåãã¾ããå¥åãã¡ã¤ã«ã®ååãä»ããããéçé
              åã®å®ç¾©ãåºåããã¾ããæ¨æºå¥åã®å ´åã¯å®ç¾©ã®ä¸èº«ã ãåºåããã¾ãã

       -l len | -len len
              <len> ãªã¯ãããã ãåºåããã

       -p | -ps | -postscript | -plain
              ãã¹ãã¹ã¯ãªããå½¢å¼ã® 16 é²ãã³ããåºåãããå¥å ãã¬ã¼ã³ 16 é²ãã³ãã

       -r | -revert
              åã«æ»ã: 16 é²ãã³ããããã¤ããªå½¢å¼ã«å¤æ (ã¾ãã¯ããã) ãã¾ãã
              ãã¡ã¤ã«ã¸åºåããå ´åãåºååã®ãã¡ã¤ã«ã¯åãè©°ãããã¾ããã
              è¡çªå·ãç¹å®ã®æ¸å¼ããªããã¬ã¼ã³ 16 é²ãã³ããèªã¿è¾¼ãå ´åã¯ã -r -p
              ãæå®ãã¦ãã ããã空ç½ã¨æ¹è¡ã¯ç¡è¦ããã¾ãã

       -seek offset
              -r ã®å¾ã§ä½¿ãããå ´å: 16 é²ãã³ããåºåãããã¡ã¤ã«ã®ä½ç½®ã« <offset>
              ãå ããã

       -s [+][-]seek
              infile ã® <seek> ãã¤ãç® (絶対ä½ç½®ãã¾ãã¯ç¸å¯¾ä½ç½®) ããéå§ããã +
              ã¯ãç¾å¨ã®æ¨æºå¥åã®ä½ç½®ããç¸å¯¾çãªä½ç½®ã示ãã¾ã (æ¨æºå¥åããèª‐
              ã¿è¾¼ãã¨ãã®ã¿æå³ãããã¾ã)ã- ã¯ãå¥åã®çµãããã ã®æåæ°ã示ãã¾ã (+
              ã¨åæã«æå®ããå ´åã¯ãç¾å¨ã®æ¨æºå¥åã®ä½ç½®ãã æåã®ä½ç½®ã示ãã¾ã)ã -s
              å¼æ°ãæå®ããªãã£ãå ´åã¯ãç¾å¨ã®ãã¡ã¤ã«ä½ç½®ããéå§ããã¾ãã

       -u     16 é²æ°ã®è¡¨è¨ã«å¤§æåã使ãã¾ããæå®ããªãå ´åã¯å°æåã§åºåããã¾ãã

       -v | -version
              ãã¼ã¸ã§ã³ã表示ãã¾ãã

è¦å
       xxd -r ã§ã¯è¡çªå·ã®è©ä¾¡ã«é¢ãã¦ã®æé»ã®ã«ã¼ã«ãããã¤ãããã¾ãã
       åºåãã¡ã¤ã«ãã·ã¼ã¯å¯è½ãªããåè¡ã®è¡çªå·ãé çªéãã«ä¸¦ãã§ãªãã¦ãæ§ãã¾ã
       ããä½ç½®ãé£ãã§ãã¦ãéãªã£ã¦ãã¦ã大ä¸å¤«ã§ãããã®å ´åã次ã®ä½ç½®ã«ç§»åãã ããã«
       lseek(2) ã使ããã¾ãã åºåãã¡ã¤ã«ãã·ã¼ã¯ä¸å¯ãªãããééãã ããå¦çå¯è½ã§ããééã¯
       null ãã¤ã ã§åãããã¾ãã

       xxd -r ã¯ä¸æ£ãªå¥åãã¨ã©ã¼ã«ãã¾ãããã´ãã¯éãã«èªã¿é£ã°ããã¾ãã

       16 é²ãã³ããç·¨éããã¨ãã¯æ³¨æãå¿è¦ã§ãã xxd -r ã¯å¿è¦ãªæ¡ (-c å¼æ°åç§) ã ã
       16 é²ãã¼ã¿ãèªã¿è¾¼ãã§ãè¡ã®æ®ããç¡è¦ãã¾ ããã¤ã¾ããascii (ã¾ã㯠ebcdic)
       ã示ãã¦ããåã¸ã®å¤æ´ã¯ç¡è¦ããã¾ãã xxd -r -p ã§ãã¬ã¼ã³å½¢å¼
       (ãã¹ãã¹ã¯ãªããå½¢å¼) ã® 16 é²ãã³ããåã«æ»ãå ´ åã¯ãåã®æ°ã¯å½±é¿ãã¾ããã 2
       æ¡ã® 16 é²æ°ã¨èªèã§ãããã®ã¯ãã¹ã¦å¤æããã¾ãã

       % xxd -i file
       ã¨
       % xxd -i < file
       ã®çµæã¯éãã¾ãã注æãã¦ãã ããã

       xxd -s +seek 㨠xxd -s seek, ã®éãã¯ãlseek(2) ã使ã£ã¦å¥åã "å·»ãæ»ã"
       ãã©ããã§ãã'+' ãæå³ãæ㤠ã®ã¯ãå¥åãæ¨æºå¥åã§ãxxd
       ãèµ·åãããã¨ãã«æ¨æºå¥åã®ãã¡ã¤ã«ä½ç½®ããã¡ã¤ ã«ã®åé ã§ã¯ãªãã£ãå ´åã§ãã
       以ä¸ã®ä¾ãåãããããããããã¾ãã (ãã£ã¨æ··ä¹±ãããã!)...

       `cat' ãæ¢ã«æ¨æºå¥åãçµããã¾ã§èªãã§ããã®ã§ãèªãåã«æ¨æºå¥åãå·»ãæ»ãå¿ è¦ãããã
       % sh -c "cat > plain_copy; xxd -s 0 > hex_copy" < file

       ãã¡ã¤ã«ä½ç½® 0x480 (=1024+128) åæ¹ãã 16 é²ãã³ãããã `+' ã¯
       ãç¾å¨å°ããã®ç¸å¯¾ä½ç½®ããæå³ããã®ã§ãdd ã 1k å¦çããå¾ããããã ã« `128' é²ãã¾ãã
       % sh -c "dd of=plain_snippet bs=1k count=1; xxd -s +128 > hex_snippet"
       < file

       ãã¡ã¤ã«ä½ç½® 0x100 ( = 1024-768) ãã 16 é²ãã³ãããã
       % sh -c "dd of=plain_snippet bs=1k count=1; xxd -s +-768 > hex_snippet"
       < file

       ãã®ãããªä½¿ãæ¹ã¯ãã¾ããã¾ãããã`+' ã使ããã¨ãã»ã¨ãã©ãªãã§ãããã -s
       ã使ãã¨ãã¯ãã¤ã§ããstrace(1) ã truss(1) ã使ã£ã¦ãxxd ã®åãããã§ã
       ã¯ãããã¨ããå§ããã¾ãã

ä¾
       ãã¡ã¤ã« ã®æåã®ä¸è¡ (16 é²æ°ã§ 0x30 ãã¤ã) 以éãåºåããã
       % xxd -s 0x30 file

       ãã¡ã¤ã« ã®æå¾ããä¸è¡ (16 é²æ°ã§ 0x30 ãã¤ã) ãåºåããã
       % xxd -s -0x30 file

       120 ãã¤ãããå¹³æ 16 é²ãã³ãå½¢å¼ã§ä¸è¡ã« 20 ãªã¯ããããã¤åºåããã
       % xxd -l 120 -ps -c 20 xxd.1
       2e54482058584420312022417567757374203139
       39362220224d616e75616c207061676520666f72
       20787864220a2e5c220a2e5c222032317374204d
       617920313939360a2e5c22204d616e2070616765
       20617574686f723a0a2e5c2220202020546f6e79
       204e7567656e74203c746f6e79407363746e7567

       ãã® man ãã¼ã¸ã®åé ãã 120 ãã¤ããä¸è¡ã« 12 ãªã¯ãããã㤠16 é²ãã³ãã ãã
       % xxd -l 120 -c 12 xxd.1
       0000000: 2e54 4820 5858 4420 3120 2241  .TH XXD 1 "A
       000000c: 7567 7573 7420 3139 3936 2220  ugust 1996"
       0000018: 224d 616e 7561 6c20 7061 6765  "Manual page
       0000024: 2066 6f72 2078 7864 220a 2e5c   for xxd"..\
       0000030: 220a 2e5c 2220 3231 7374 204d  "..\" 21st M
       000003c: 6179 2031 3939 360a 2e5c 2220  ay 1996..\"
       0000048: 4d61 6e20 7061 6765 2061 7574  Man page aut
       0000054: 686f 723a 0a2e 5c22 2020 2020  hor:..\"
       0000060: 546f 6e79 204e 7567 656e 7420  Tony Nugent
       000006c: 3c74 6f6e 7940 7363 746e 7567  <tony@sctnug

       xxd.1 ã®æ¥ä»é¨åã ããåºåããã
       % xxd -s 0x36 -l 13 -c 13 xxd.1
       0000036: 3231 7374 204d 6179 2031 3939 36  21st May 1996

       input_file ã output_file ã«ã³ãã¼ããåé ã« 0x00 ã 100 ãã¤ãåä»ãå ããã
       % xxd input_file | xxd -r -s 100 > output_file

       xxd.1 ã®æ¥ä»ãä¿®æ£ããã
       % echo "0000037: 3574 68" | xxd -r - xxd.1
       % xxd -s 0x36 -l 13 -c 13 xxd.1
       0000036: 3235 7468 204d 6179 2031 3939 36  25th May 1996

       ä¸èº«ããã¹ã¦ 0x00 ã® 65537 ãã¤ãã®ãã¡ã¤ã«ãä½æããã ãã ããæå¾ã®ãã¤ãã ã㯠'A'
       (hex 0x41)ã
       % echo "010000: 41" | xxd -r > file

       ä½æãããã¡ã¤ã«ããªã¼ãã¹ãããã使ã£ã¦ 16 é²ãã³ãããã
       % xxd -a -c 12 file
       0000000: 0000 0000 0000 0000 0000 0000  ............
       *
       000fffc: 0000 0000 40                   ....A

       ä¸æåã® 'A' ãããªã 1 ãã¤ãã®ãã¡ã¤ã«ãä½æããã
        '-r -s' ã®å¾ã«æå®ããæ°å¤ããã¡ã¤ã«ä¸ã®è¡çªå·ã«å ç®ãããçµæãä½è¨ãªã
       ã¤ããé£ã°ãããã
       % echo "010000: 41" | xxd -r -s -0x10000 > file

       vim(1) ã®ä¸ãã xxd ããã£ã«ã¿ã¨ãã¦å®è¡ãã ãã¼ã¯ããã `a' ãã `z' ã¾ã§ã®é åã 16
       é²ãã³ãããã
       :'a,'z!xxd

       vim(1) ã®ä¸ãã xxd ããã£ã«ã¿ã¨ãã¦å®è¡ãã ãã¼ã¯ããã `a' ãã `z'
       ã¾ã§ã®é åããã¤ããªã«æ»ãã
       :'a,'z!xxd -r

       vim(1) ã®ä¸ãã xxd ããã£ã«ã¿ã¨ãã¦å®è¡ãã 16
       é²ãã³ããããè¡ãåã«æ»ããæ»ãããè¡ã«ã«ã¼ã½ã«ã移åãã¦:
       !!xxd -r

       ã·ãªã¢ã«è¡ããä¸æåèªã¿è¾¼ã
       % xxd -c1 < /dev/term/b &
       % stty < /dev/term/b -echo -opost -isig -icanon min 1
       % echo -n foo > /dev/term/b

è¿ãå¤
       以ä¸ã®ã¨ã©ã¼å¤ãè¿ãã¾ã:

       0      ã¨ã©ã¼ãªãã

       -1     æä½ããµãã¼ãããã¦ããªã ( xxd -r -i ã¯ã¾ã ä¸å¯ã§ã)ã

       1      å¼æ°ã®è§£éã«é¢ããã¨ã©ã¼ã

       2      å¥åãã¡ã¤ã«ã«é¢ããåé¡ã

       3      åºåãã¡ã¤ã«ã«é¢ããåé¡ã

       4,5    æå®ãããä½ç½®ã¸ã·ã¼ã¯ã§ããªãã£ãã

é¢é£é ç®
       uuencode(1), uudecode(1), patch(1)

è¦å
       ãã®å¥å¦ãªãã¼ã«ã¯ä½èã使ããããããã«ä½ããã¦ãã¾ãã
       èªå·±è²¬ä»»ã§ä½¿ã£ã¦ãã ããããã¡ã¤ã«ãã³ãã¼ããããã調ã¹ãã¦ã£ã¶ã¼ãããã

ãã¼ã¸ã§ã³
       ãã®ããã¥ã¢ã«ã¯ xxd ãã¼ã¸ã§ã³ 1.7 ã«ã¤ãã¦èª¬æãã¦ãã¾ãã

èè
       (c) 1990-1997 by Juergen Weigert
       <jnweiger@informatik.uni-erlangen.de>

       ç§ã®å績ã¨ãã¦èªç±ã«éå¸ãã¦ãã ããã
       å²ãã£ããæãã¦ãã ããã
       æãã¦ãç¥ãã¾ããã

       ããã¥ã¢ã«ã¯ Tony Nugent
       <tony@sctnugen.ppp.gu.edu.au> <T.Nugent@sct.gu.edu.au>
       ã«ãã£ã¦æ¸ããã Bram Moolenaar ãå°ãå¤æ´ãå ãã Juergen Weigert ãç·¨éãã¾ããã

Manual page for xxd               August 1996                           XXD(1)