๐ŸŒ
Network World
networkworld.com โ€บ home โ€บ blogs โ€บ unix as a second language
Using Linux hexedit and xxd commands to view and modify binary files | Network World
February 27, 2025 - The hexedit command provides a way to edit binary files, but to view and save the content in a file for later analysis without editing, try the xxd command.
๐ŸŒ
Certbolt
certbolt.com โ€บ home โ€บ the xxd command explained: a must-have for linux system administrators
The XXD Command Explained: A Must-Have for Linux System Administrators - Certbolt | IT Certification News
May 13, 2026 - The minus-r flag tells xxd to read a hex dump as input and convert it back into the original binary data. This means you can take xxd output, modify it in a text editor, and then convert it back into a binary file โ€” effectively patching binary files using nothing but a text editor and the ...
๐ŸŒ
LinuxConfig
linuxconfig.org โ€บ home โ€บ linux xxd command explained
Using xxd Command in Linux: Installation & Guide
September 22, 2025 - This allows us to glean information ... the file back to binary. Through lots of trial and error, it is possible to edit a file in the way you desire with xxd....
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ unix_commands โ€บ xxd.htm
xxd - Unix, Linux Command
Use xxd as a filter within an editor such as vim(1) to recover a binary hexdump marked between ย‘aย’ and ย‘zย’. :ย’a,ย’z!xxd -r
๐ŸŒ
IOTRouter
en.iotrouter.com โ€บ view-and-modify-binary-files-using-linux-hexedit-and-xxd-commands
Use The Hexedit And Xxd Commands To View And Modify Binary Files - IOTROUTER
December 18, 2023 - The hexedit command can be used to display the contents of binary files (images, executables, etc.) and the xxd command can be used to display and save the contents of these files for later analysis in the format shown above.
๐ŸŒ
Unix Community
community.unix.com โ€บ shell programming and scripting
Edit file hexadecimal with xxd - Shell Programming and Scripting - Unix Linux Community
February 5, 2016 - Hi all: I need edit a hexadecimal file. for example: 000d530: 0000 0000 0000 0000 0000 0000 493a 004f ............I:.O 000d540: 6374 2032 3820 3230 3135 2031 393a 3234 ct 28 2015 19:24 I need to cut the chain(black) and corresponding to hexadecimal from the chain at the end of file something like this serve? xxd file | sed '/493a/d' | xxd -r -p thanks
๐ŸŒ
Linux Man Pages
linux.die.net โ€บ man โ€บ 1 โ€บ xxd
xxd(1): make hexdump/do reverse - Linux man page
Use xxd as a filter within an editor such as vim(1) to recover a binary hexdump marked between 'a' and 'z'. :'a,'z!xxd -r
Find elsewhere
๐ŸŒ
Computer Hope
computerhope.com โ€บ unix โ€บ xxd.htm
Linux Xxd Command
June 1, 2025 - The xxd program takes a file or standard input and outputs a hex dump that uses only ASCII or EBCDIC (Extended Binary Coded Decimal Interchange Code) characters. This output hex dump can be safely emailed and reconstructed at the destination. It can also take an equivalently formatted hex dump and convert it back to binary form, allowing binary files to be edited or patched as text.
Top answer
1 of 1
10

You can use vim which should already be installed.

Just to make sure, go ahead and install vim:

sudo apt-get update
sudo apt-get install vim

Now, use the vim command :%! xxd -b to edit binary like in this example:

vim /path/to/filename

note: you can drag and drop the file into the terminal to automatically fill in the path for you

FYI, the :%! command prefix allows you to pipe the current file's contents to command's stdin, and replaces the file's contents with command's stdout. xxd is a linux command.

Once the file is open, press ESC and then type :%! xxd -b and then press ENTER.

Alternatively, you can add the flag -g4 to group the bits into 32 bit packets like :%! xxd -b -g4

For hex edit, use the vim command :%! xxd instead or :%! xxd -g4

Press ESC and then i for "INSERT" mode which allows you to edit.

Press ESC and then type :w followed by ENTER to save the file.

Press ESC and then type :q followed by ENTER or ESC and then type :q! followed by ENTER to exit the file.

Vim takes some getting used to but is really great once you take the time to learn how it works.

Additionally, vim allows you to edit just about anything including sqlite and all kinds of other stuff.

Also, when you convert a binary to hex and then edit, I think you may need to convert back to binary by using :%! xxd -r command as described here.

More info can be found at the official wiki by clicking here.

Here is a similar post:

https://unix.stackexchange.com/questions/282215/how-to-view-a-binary-file/282220

Click here for more info on editing your .vimrc file to allow some related commands.


A very similar editor is bvi. Run the following command to install:

sudo apt-get install bvi

Click here for more info.

๐ŸŒ
thelinuxvault
thelinuxvault.net โ€บ blog โ€บ linux-xxd-command-explained
Linux xxd Command Explained
In the world of Linux, working ... utility that generates hex dumps, reverses them back to binary, and even helps edit binary files indirectly....
๐ŸŒ
YouTube
youtube.com โ€บ watch
How to Use xxd โ€“ View & Edit Hex Dumps in Linux! - YouTube
Need to inspect binary files, debug raw data, or convert text to hex? In this video, we'll show you how to use the xxd command to create hex dumps of any fil...
Published: June 12, 2026
๐ŸŒ
Linux Command Library
linuxcommandlibrary.com โ€บ man โ€บ xxd
xxd man | Linux Command Library
In vim, use :%!xxd to convert buffer to hex dump, edit the hex values, then :%!xxd -r to convert back to binary.
๐ŸŒ
Analytics Vidhya
analyticsvidhya.com โ€บ home โ€บ understanding the xxd command in linux
Understanding the xxd Command in Linux
June 26, 2024 - This is where the xxd command proves invaluable. xxd is a handy utility available on most Linux systems that enables you to generate a hexadecimal representation of a file or even revert a hex dump back to its original binary format.
๐ŸŒ
Voxfor
voxfor.com โ€บ blog โ€บ linux guides โ€บ how to edit binary data using hex editors in linux
How to edit binary data using HEX Editors in Linux
May 22, 2026 - Choose a hex editor based on your workflow needs. Command-line tools like xxd or hexedit are excellent for quick tasks, while GUI tools like Bless or GHex can be more comfortable for in-depth visual analysis. Installation is generally straightforward, thanks to well-maintained repositories in most Linux distributions.
๐ŸŒ
LinkedIn
linkedin.com โ€บ posts โ€บ centizen_using-linux-hexedit-and-xxd-commands-to-view-activity-7031158668364587008-nJdP
Centizen, Inc. on LinkedIn: Using Linux hexedit and xxd commands to view and modify binary files
February 14, 2023 - 1. Using hexedit 2. Using xxd The ... executables and such) and the xxd command can be used to display and save the content of these files for later analysis in the format displayed above....
๐ŸŒ
Robert Elder
blog.robertelder.org โ€บ intro-to-xxd-command
Intro To 'xxd' Command In Linux
May 27, 2024 - I use the 'xxd' command to produce a hexadecimal dump of a binary file: ยท I can also use the '-r' flag to go the other way, by converting a hex dump back into a binary file: