Use VI in Mac to modify binary files

Source: Internet
Author: User

Use VI in Mac to modify binary files

1. First edit this file in binary mode
Vi-b datafile

2. Use XXD to convert to 16 binary
:%!xxd

The text looks like this:

0000000:1f8b 0808 39d7 173b 0203 7474 002b 4e49 .... 9..;.. Tt.+ni
0000010:4B2C 8660 eb9c ECAC c462 eb94 345e 2e30 K,.. 4^.0
0000020:373b 2731 0b22 0ca6 c1a2 d669 1035 39d9 7; ' 1. "..... i.59.

Now you can read and edit the text as you wish. Vim treats this information as plain text.

3. Convert 16 binary back VI
:%!xxd-r

4. Save
: Wq

User-aware
Links: https://www.zhihu.com/question/22281280/answer/34778466
Source: Know
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.

Use VI in Mac to modify binary files

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.