LinuxCommandLibrary

hexedit

Edit binary files in hexadecimal

TLDR

Open file

$ hexedit [path/to/file]
copy

Display file with sectors
$ hexedit [[-s|--sector]] [path/to/file]
copy

Maximize file display
$ hexedit [[-m|--maximize]] [path/to/file]
copy

Display help
$ hexedit [[-h|--help]]
copy

SYNOPSIS

hexedit [-m] [-g] [-h] [-f] [filename]

PARAMETERS

-m
    monochrome display (no colors)

-g
    don't group hex digits (continuous dump)

-h
    display this help screen

-f
    force write to read-only file or device

DESCRIPTION

Hexedit is a compact, ncurses-based tool for viewing and editing files in hexadecimal and ASCII formats side-by-side. It displays the hex dump on the left with the ASCII interpretation on the right, allowing precise byte-level modifications.

Navigate with arrow keys, edit in insert (Ins) or overwrite mode, search hex/text (Ctrl+S), undo/redo (Ctrl+R/G), and handle blocks. Supports files, block devices, stdin/stdout. Save with F2 or Ctrl+X to exit.

Perfect for binary debugging, firmware tweaks, or disk forensics on minimal systems. No X11 needed, just ncurses. Use -f for read-only files/devices, but verify changes—edits are permanent on save.

CAVEATS

Risk of data corruption on binaries/devices; always backup. Avoid editing mounted filesystems. No autosave—explicit save required.

KEY BINDINGS

Arrows/PgUp/Dn: navigate
Ins: toggle insert/overwrite
F1: help
F2: save
Ctrl+S: search
Ctrl+X: exit
Ctrl+R/G: undo/redo

DISPLAY INFO

Status line shows offset, file size. ? shows byte value. Supports large files via paging.

HISTORY

Created by Pavel Janík ml. in 1998, hexedit originated as a simple hex viewer/editor for Slackware. Evolved with ncurses support; maintained via sourceforge, remains lightweight for legacy/modern Linux.

SEE ALSO

hexdump(1), xxd(1), od(1), hd(1)

Copied to clipboard