by Devin Yang
(This article was automatically translated.)

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.
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

 

Tags: vim

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


vim

About vimdiff

My vimdiff cheat sheet

config,vim

Chinese environment of Vim on Ubuntu

If Vim is set to Chinese environment, but Ubuntu is not set to zh_TW.UTF-8 during installation, how to install this environment?

vim

Write Code with Command Line's Vim??

If you are a beginner of Vim, do you want to use Command Line Vim to connect to the remote host to write Code? Ok you've come to the right place, please at least consider reading this article. Here is a short video on how to manage cheats...