Published - 6 years ago ( Updated - 6 years ago )
Here is a simple record of how to use Vim to edit Binary files.
Open the binary file for editing.. Here, an external command xxd is used to view the hexadecimal encoding.
The command below displays the binary file of ls in the vi editor in hexadecimal.
To save, use xxd -r:
Open the binary file for editing.. Here, an external command xxd is used to view the hexadecimal encoding.
The command below displays the binary file of ls in the vi editor in hexadecimal.
xxd /usr/bin/ls|vi -
Just an example, don't really change...@@To save, use xxd -r:
:%!xxd -r > new-ls
If the file has been opened, it can also be converted to binary by the following command
:%!xxd
After modification, you can use the following command to return, and then save
:%!xxd -r
No Comment
Post your comment