출처 : http://www.linuxinstead.com/blog/2009/04/21/using-vi-as-a-hex-editor/



Sometimes I find it useful to switch to hex mode when editing a file in vi. The command for switching is not very obvious so thought I’d share…

So, open a file in vi as usual, hit escape and type:
:%!xxd to switch into hex mode

And when your done hit escape again and type:
:%!xxd -r to exit from hex mode.

Okay, so this isn’t actaully switching to vi’s ‘hex mode’; vi doesn’t have one. What the above actually does is to stream vi’s buffer through the external program ‘xxd’.


※주의 할 점

1. 헥사 뷰어 모드에서는 헥사 부분만을 수정하여야 한다. 주소를 부분을 수정하면 파일이 잘못되고 본문 부분을 수정할 경우 변함이 없다. 주소값과 헥사 값을 가지고 재 생성하는 듯 하다.

2. 헥사 뷰어 모드에서수정후 원래 모드로 반드시 돌아온 후 저장을 하여야 한다. 돌아 오지 않고 저장 할 경우 눈에보여지는 헥사모드 그대로의 값들이 저장된다.



WRITTEN BY
RootFriend
개인적으로... 나쁜 기억력에 도움되라고 만들게되었습니다.

,