Use VI to edit binary files

Source: Internet
Author: User
Use VI to edit the binary file 1. open the file in binary mode # vi-bfile. for example, the file content is originally helloworld! 2. switch to Binary Display. in vi command mode, enter: %! Xxd000000: 68656c6c6f20776f0000c6420210a... use VI to edit the binary file 1. open the file in binary mode # vi-B file. for example, the file content is "hello world! 2. switch to Binary Display. in vi command mode, enter: %! Xxd 000000: 6865 6c6c 6f20 776f RJC 6420 210a hello world !. 4. if you want to modify a byte, change the character on the left to the right, for example, change the w character to x, and the binary value of w to 77 and x to 78, that is to say, change the corresponding 77 to 78 to 000000: 6865 6c6c 6f20 776f RJC 6420 210a + --> Here, change 77 to 78 3. switch back to vi command mode and enter: %! Xxd-r at this time, the content in the window will be changed to hello xorld! 4. enter "wq" to save and exit. that's easy!
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.