There are several cmdline hex editors available on Linux, even vim can use the
xxd utility to edit a file in hex mode (
:%!xxd to edit,
:%!xxd -r to return to text mode). You may have come across
ghex as well, the standard Gnome hex editor. We found a lightweight and powerful hex utility in the default Ubuntu repos – jeex. jeex is also written in Gtk+ and you don’t have to bother about dependencies (unlike
bless, which takes it to mono libraries!!!). Continue reading jeex: useful hex tool
fileobj is a fresh Linux hex editor with a vi like interface and key bindings. It needs python 2.6 or above to run. The interface needs the ncurses library. The binary editing commands supported in fileobj are like vi. Besides the vi-like editing options, one of the key features of fileobj is the ability to load a user-specified region from a large file for editing. Continue reading fileobj: hex editor in python
One of our readers requested a list of editors on Linux capable of editing huge files in the order of GBs. In one of our earlier articles we explored some commands to create huge files on Linux. We also visited glogg, a log viewer with similar capabilities but it cannot edit files. Here’s a list of some robust editors.
A Qt based GUI editor. Can view and edit files in hex, octal, binary, or ascii text mode. Can work with files much larger than system RAM or even address space.
- Low memory usage
- Instant load times
- Instant save times
- Infinite undo/redo
- Dynamic hex/octal/binary/ascii editing mode
- “Goto” field for jumping to a specified offset (offset can be specified by a mathematical expression: 0xff*3
- 64 bit offset support
- Dynamic resize support
- Conversion dialog
> Linked to selection
> Shows conversion to int, float, double, ascii, hex
> Modifying int/float/double/ascii/hex updates all the other fields
> Option to show/edit byteswapped values
- Binary comparison dialog
> Differences can be walked by “block”
> A block can be from 1-16 bytes long
> Starting offset can be different in each file
- Minimal dependencies (just Qt)
- Does not support insertion/deletion (cannot change file size)
- Search/compare can be slow (compared to cmp or any other non-paged IO app)
- Cannot search files with unsaved modifications
To install on Ubuntu:
$ sudo apt-get install lfhex
Joe s a very powerful full-featured terminal editor. Written in C and the only dependency is libc.
- Can view and edit files in text of hex mode
- Supports UTF8 characters
- Multi-file search and replace- file list is either given on cmdline or by a UNIX command (grep/find) run from within JOE
- Mouse support, including wheel (works best when using xterm). The mouse can resize windows, scroll windows, select and paste text, and select menu entries.
- Context display on status line: allows you to see name of function cursor is in
- Syntax highlighting
- Swap file allows editing files larger than memory
- Bash-like TAB completion and history for all prompts
- Jump to matching delimiter
- and many more…
- NO vertical windows
- No folding
- No background spell checking, like Microsoft WORD
- Cannot highlight all matching words
To install on Ubuntu:
$ sudo apt-get install joe
HEd is a powerful hex editor with a hexdump -C like interface. It can load and edit infinitely large files.
- Very fast on very large files (keeps only necessary portion of the file in memory)
- Fast inserting anywhere in the file
- Fast saving of intermediate changes
- vim-like controls (and exmode)
- Powerful expressions concept for flexible searching and transformation operations on the file or a selected region
HEd is not available by default on Ubuntu. Download HEd v0.5 compiled on Ubuntu 14.04 amd64 here.
This is a plugin available for vim that turns off certain vim features to handle large files. The
g:LargeFile (by default 100) option describes the minimum size of a file to be considered as a LargeFile, in megabytes. This option can be set in ~/.vimrc as:
Note that LargeFile may not be able to handle a 1GB file as it doesn’t change the way vim opens a file.
Download the latest version from the homepage. Then:
$ vi LargeFile.vba.gz
Systems programmers need a hex editor frequently. Here are some options:
- A file can be viewed/edited in hex mode from vi using the :%!xxd and :%!xxd -r combination but it is not too strong and needs careful editing.
- An efficient and easy to use cmdline tool for editing files in hex mode is ncurses-hexedit which is available in Synaptic package manager on Ubuntu. The editor has many options like search, go to location, insert, delete bytes etc. which are more than enough for regular usage. After installing the package, run:
$ hexeditor filename
- wxHex Editor has a GUI and is multiplatform. It can support massive files.
If you are looking for a hex file compare utility cum editor:
- VBinDiff: can compare and edit files.
- dhex: only diff viewer.
- cmp: options.