How to edit hex values in Vi


Editing binary filesEdit  href= Edit

Use the -b option to set binary mode before editing a binary file, for example:
vim -b myfile.bin
If wanted, you can display nonprintable characters in hex, and you can wrap lines:
:setlocal display=uhex
:setlocal wrap
In normal mode, type g then Ctrl-G to display the byte number at the cursor, or type a byte number then go to jump to that byte (for example, 123go will jump to byte number 123). The first byte in the file has byte number 1.
The following command replaces the buffer with a hex dump:
:%!xxd
You can edit the hex bytes, then convert the file back to binary with the command:
:%!xxd -r
The above command reverses the hex dump by converting the hex bytes to binary (the printable text in the right column is ignored).

Comments

good Information

I found this videos which explain how to use VI

http://worldwebinar.org/operating-systems/linux/20-how-to-use-the-vi-editor.html

I think it's will be useful

Popular posts from this blog

Vim vi how to reload a file your editing