在vi的命令状态下 :
:%!xxd ——将当前文本转换为16进制格式。
:%!od ——将当前文本转换为16进制格式。
:%!xxd -c 12——将当前文本转换为16进制格式,并每行显示12个字节。
:%!xxd -r ——将当前文件转换回文本格式。
xxd工具: xxd creates a hex dump of a given file or standard input. It can also convert a hex dump back to its original binary form.
od工具: Write an unambiguous representation, octal bytes by default, of FILE to standard output. With more than one FILE argument, concatenate them in the listed order to form the input.
本文介绍如何使用vi编辑器进行文本到16进制格式的转换及还原的方法。利用vi内置命令如:%!xxd和:%!od可以轻松完成转换,并提供了xxd和od工具的具体用法。此外还介绍了如何指定每行显示的字节数。
1216

被折叠的 条评论
为什么被折叠?



