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-B file. For example, the file content is originally 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.