{"id":751,"date":"2023-06-27T11:07:43","date_gmt":"2023-06-27T05:37:43","guid":{"rendered":"https:\/\/www.cyberaka.com\/?p=751"},"modified":"2023-06-27T11:08:41","modified_gmt":"2023-06-27T05:38:41","slug":"viewing-files-in-hex-mode","status":"publish","type":"post","link":"https:\/\/www.cyberaka.com\/?p=751","title":{"rendered":"Viewing files in hex mode"},"content":{"rendered":"\n<p>Sometimes I need to look at files in their actual hexadecimal format. I use the combination of vi and hexdump to fulfill this requirement.<\/p>\n\n\n\n<p>To simply view a file\u2019s content in hex format I use this command on my mac.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hexdump -C &lt;file_name&gt;<\/code><\/pre>\n\n\n\n<p>This typically is enough for the job at hand. However there is also another trick of using hexdump by leveraging vi command. I follow the following steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Start vi by typing \u201cvi &lt;file_name&gt;\u201d on the command line.<\/li>\n\n\n\n<li>Type \u201c:%!hexdump -C\u201d<\/li>\n\n\n\n<li>This will replace the contents of the vi screen with the hex view of the current file.<\/li>\n\n\n\n<li>Save the file for future use. <\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes I need to look at files in their actual hexadecimal format. I use the combination of vi and hexdump to fulfill this requirement. To simply view a file\u2019s content in hex format I use this command on my mac. This typically is enough for the job at hand. However there is also another trick [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,35,24],"tags":[],"class_list":["post-751","post","type-post","status-publish","format-standard","hentry","category-linux-os","category-mac-os","category-tips-and-tricks"],"_links":{"self":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/751","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=751"}],"version-history":[{"count":3,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/751\/revisions"}],"predecessor-version":[{"id":755,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/751\/revisions\/755"}],"wp:attachment":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=751"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=751"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=751"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}