{"id":593,"date":"2021-10-17T14:16:00","date_gmt":"2021-10-17T14:16:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=593"},"modified":"2021-10-17T14:16:00","modified_gmt":"2021-10-17T14:16:00","slug":"593","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2021\/10\/17\/593\/","title":{"rendered":"Linux\u7cfb\u7edf\u663e\u793a16\u8fdb\u5236\u5de5\u5177  hexdump   hexyl  hexedit"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/10\/3721501364.png\" alt=\"hz.png\" title=\"hz.png\"><\/p>\n<h2>Linux\u7cfb\u7edf\u663e\u793a16\u8fdb\u5236\u5de5\u5177 \u4e3b\u8981\u6709 hexdump   hexyl  hexedit \u4e09\u6b3e<\/h2>\n<ul>\n<li><code>hexdump<\/code> \u76ee\u524d\u5728Debian 11\u4e2d\u53d6\u6d88\u9884\u88c5\uff0c\u9700\u8981\u5b89\u88c5 <code>bsdmainutils<\/code> \u5305\uff0c\u5b89\u88c5\u540e\u8fd8\u4f1a\u5b89\u88c5 <code>ncal cal hd hexdump<\/code>\u7b49<\/li>\n<li>ncal \u548c cal \u663e\u793a\u4e00\u4e2a\u5f53\u6708\u65e5\u5386\uff0c<code>hd<\/code> \u662f hexdump \u7684\u7f29\u5199\u547d\u4ee4<\/li>\n<li><code>hexyl<\/code> \u53ef\u4ee5\u5f69\u8272\u6587\u672c\u663e\u793a16\u8fdb\u5236\uff0c\u5b57\u6bcd \u7a7a\u683c \u548c \u6c49\u5b57(\u6570\u636e)\uff0c\u4f1a\u533a\u5206\u663e\u793a\uff0c\u63a8\u8350\u5b89\u88c5\u548c\u4f7f\u7528<\/li>\n<li><code>hexedit<\/code> \u53ef\u4ee5\u7f16\u8f9116\u8fdb\u5236\u6587\u4ef6<\/li>\n<li>\u9664\u4e86\u8fd93\u6b3e\u8f6f\u4ef6\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528  <code>xxd<\/code> \u663e\u793a16 \u8fdb\u5236\uff0c\u8fd9\u4e2a\u8f6f\u4ef6\u662f <code>vim<\/code> \u7684\u63d2\u4ef6<\/li>\n<\/ul>\n<pre><code>apt install bsdmainutils hexedit hexyl\necho \"\u6c49\u5b57 UTF-8\" &gt; hz.txt\ncat hz.txt\nhexdump hz.txt\nhd hz.txt\nhexyl hz.txt\nhexedit hz.txt\nvim -b hz.txt<\/code><\/pre>\n<h2>vim\u4e2d\u663e\u793a16\u8fdb\u5236\u7684\u503c<\/h2>\n<p>\u4e00\u4e2a\u771f\u6b63\u7684\u4e8c\u8fdb\u5236\u7f16\u8f91\u5668\u7528\u4e24\u79cd\u65b9\u5f0f\u6765\u663e\u793a\u6587\u672c: \u4e8c\u8fdb\u5236\u548c\u5341\u516d\u8fdb\u5236\u683c\u5f0f\u3002\u4f60\u53ef\u4ee5\u5728 Vim<br \/>\u91cc\u901a\u8fc7\u8f6c\u6362\u7a0b\u5e8f <code>xxd<\/code> \u6765\u8fbe\u5230\u8fd9\u6548\u679c\u3002\u8be5\u7a0b\u5e8f\u662f\u968f Vim \u4e00\u8d77\u53d1\u5e03\u7684\u3002<br \/>   \u9996\u5148\u4ee5\u4e8c\u8fdb\u5236\u65b9\u5f0f\u7f16\u8f91\u8fd9\u4e2a\u6587\u4ef6:<\/p>\n<pre><code>    vim -b datafile\n<\/code><\/pre>\n<p>\u73b0\u5728\u7528 xxd \u628a\u8fd9\u4e2a\u6587\u4ef6\u8f6c\u6362\u6210\u5341\u516d\u8fdb\u5236:<\/p>\n<pre><code>    :%!xxd\n<\/code><\/pre>\n<p>\u6587\u672c\u770b\u8d77\u6765\u50cf\u8fd9\u6837:<\/p>\n<pre><code>    0000000: 1f8b 0808 39d7 173b 0203 7474 002b 4e49  ....9..;..tt.+NI\n    0000010: 4b2c 8660 eb9c ecac c462 eb94 345e 2e30  K,.\".....b..4^.0\n    0000020: 373b 2731 0b22 0ca6 c1a2 d669 1035 39d9  7;'1.\".....i.59.\n<\/code><\/pre>\n<p>\u73b0\u5728\u4f60\u53ef\u4ee5\u968f\u5fc3\u6240\u6b32\u5730\u9605\u8bfb\u548c\u7f16\u8f91\u8fd9\u4e9b\u6587\u672c\u4e86\u3002 Vim \u628a\u8fd9\u4e9b\u4fe1\u606f\u5f53\u4f5c\u666e\u901a\u6587\u672c\u6765\u5bf9\u5f85\u3002<br \/>\u4fee\u6539\u4e86\u5341\u516d\u8fdb\u5236\u90e8\u5206\u5e76\u4e0d\u5bfc\u81f4\u53ef\u6253\u5370\u5b57\u7b26\u90e8\u5206\u7684\u6539\u53d8\uff0c\u53cd\u4e4b\u4ea6\u7136\u3002<br \/>   \u6700\u540e, \u7528\u4e0b\u9762\u7684\u547d\u4ee4\u628a\u5b83\u8f6c\u6362\u56de\u6765:<\/p>\n<pre><code>    :%!xxd -r\n<\/code><\/pre>\n<p>\u53ea\u6709\u5341\u516d\u8fdb\u5236\u90e8\u5206\u7684\u4fee\u6539\u624d\u4f1a\u88ab\u91c7\u7528\u3002\u53f3\u8fb9\u53ef\u6253\u5370\u6587\u672c\u90e8\u5206\u7684\u4fee\u6539\u5ffd\u7565\u4e0d\u8ba1\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u7cfb\u7edf\u663e\u793a16\u8fdb\u5236\u5de5\u5177 \u4e3b\u8981\u6709 hexdump hexyl hexedit \u4e09\u6b3e hexdu [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-593","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/593","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=593"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/593\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}