Commond Commands in Vim command-line Mode

Edit binary, image and others files in hexadecimal and save the changes:

:%!xxd
  •  :   Enter command-line mode.
  • %  Matches the whole file as a range. 
  • !    Filters that range through an external command. 
  • xxd   is the external shell command.

 

The hexadecimal part on the left side of editing is valid, and the text part on the right side of editing is invalid.

Save the changes(take gif file as an example):

:%!xxd -r > 1_changed.gif


Comments

Popular posts from this blog

BdsDex: failed to load Boot0001 "UEFI BHYVE SATA DISK BHYVE-OABE-20A5-E582" from PciRoot(0x0)/Pci (0x2, 0x0)/Stat(0x0,0xFFFF,0x0) : Not Found

How To Install Nginx, MySQL and PHP (FEMP) Stack on FreeBSD 13.0

Install samba on FreeBSD(on VMware Workstation) to share files with Window.