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

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

vim

About vimdiff

My vimdiff cheat sheet

vim, macos

Ultisnips requires py >= 2.7 or py3 Bugfix

If you install Vim like me, will there be an error that python2.7 or python3 is required when executing the terminal, but the system obviously has python 2.7? This article explains how I fixed this issue.