HEXEDIT(1)
π NAME π
okay so bestie, this is hexedit, from the General Commands Manual (section 1, iykyk) β she views and edits files in hexadecimal or in ASCII π β¨
π SYNOPSIS π
hexedit [-s | --sector] [-m | --maximize] [-l<n> | --linelength <n>] [-h
| --help] [filename]
π DESCRIPTION π
hexedit shows a file both in ASCII and in hexadecimal. no cap. and listen β the file can be a device too, because the file is read a piece at a time π§
you can modify the file and search through it. it's giving main character energy fr fr π¦
β¨ OPTIONS β¨
-s,--sectorβ format the display so you get entire sectors. aesthetic.-m,--maximizeβ try to maximize the display. she wants the whole screen, periodt π--colorβ display colors π¨ (this feature is only available if your operating system supports it, so vibe check your OS first).-l<n>,--linelength <n>β explicitly set the number of bytes to display per line to n. you're the boss.-h,--helpβ show the usage. we love a helper π«Ά
β COMMANDS (quickly) β
π¦ Moving
<,>: go to start/end of the fileRight: next characterLeft: previous characterDown: next lineUp: previous lineHome: beginning of lineEnd: end of linePUp: page forwardPDown: page backward
πΈ Miscellaneous
F2: saveF3: load fileF1: helpCtrl-L: redrawCtrl-Z: suspendCtrl-X: save and exitCtrl-C: exit without savingTab: toggle hex/asciiReturn: go toBackspace: undo previous characterCtrl-U: undo allCtrl-S: search forwardCtrl-R: search backward
π Cut&Paste
Ctrl-Space: set markEsc-W: copyCtrl-Y: pasteEsc-Y: paste into a fileEsc-I: fill
π COMMANDS (full and detailed) π
okay this is the full lore drop, every single binding, no skipping, we stay thorough π
Right-Arrow,Left-Arrow,Down-Arrow,Up-Arrowβ move the cursor.Ctrl+F,Ctrl+B,Ctrl+N,Ctrl+Pβ move the cursor.Ctrl+Right-Arrow,Ctrl+Left-Arrow,Ctrl+Down-Arrow,Ctrl+Up-Arrowβ move n times the cursor.Esc+Right-Arrow,Esc+Left-Arrow,Esc+Down-Arrow,Esc+Up-Arrowβ move n times the cursor.Esc+F,Esc+B,Esc+N,Esc+Pβ move n times the cursor.Home,Ctrl+Aβ go the beginning of the line.End,Ctrl+Eβ go to the end of the line.Page up,Esc+V,F5β go up in the file by one page.Page down,Ctrl+V,F6β go down in the file by one page.<,Esc+<,Esc+Homeβ go to the beginning of the file.>,Esc+>,Esc+Endβ go to the end of the file (for regular files that have a size).Ctrl+Zβ suspend hexedit.Ctrl+U,Ctrl+_,Ctrl+/β undo all (forget the modifications).Ctrl+Qβ read next input character and insert it (this is useful for inserting control characters and bound keys).Tab,Ctrl+Tβ toggle between ASCII and hexadecimal./,Ctrl+Sβ search forward (in ASCII or in hexadecimal, use TAB to change).Ctrl+Rβ search backward.Ctrl+G,F4β go to a position in the file.Returnβ go to a sector in the file if--sectoris used, otherwise go to a position in the file.Esc+Lβ display the page starting at the current cursor position.F2,Ctrl+Wβ save the modifications.F1,Esc+Hβ help (show the man page).Ctrl+O,F3β open another fileCtrl+Lβ redisplay (refresh) the display (useful when your terminal screws up).Backspace,Ctrl+Hβ undo the modifications made on the previous byte.Esc+Ctrl+Hβ undo the modifications made on the previous bytes.Ctrl+Space,F9β set mark where cursor is.Esc+W,Delete,F7β copy selected region.Ctrl+Y,Insert,F8β paste (yank) previously copied region.Esc+Y,F11β save previously copied region to a file.Esc+I,F12β fill the selection with a stringEsc+Tβ truncate the file at the current locationCtrl+Cβ unconditional quit (without saving).F10,Ctrl+Xβ quit.
for the Esc commands, it sometimes works to use Alt instead of Esc. funny things here (especially for froggies :) egrave = Alt+H , ccedilla = Alt+G, Alt+Y = ugrave. iconic honestly πΈ
π« Modeline
at the bottom of the display you have the modeline (copied from emacs). as in emacs, you have the indications --, ** and %% meaning unmodified, modified and read-only. then you have the name of the file you're currently editing. next to it is the current position of the cursor in the file followed by the total file size. the total file size isn't quite correct for devices tho, so don't come for her about that.
while in --sector mode, it shows the sector the cursor is in.
π Editing
you can edit in ASCII or in hexadecimal. you can switch between the two with Tab. when the file is read-only, you can't edit it. when trying to edit a read-only file, a message "File is read-only" tells you it is non-writable. rude but helpful.
the modifications are shown in bold until they are saved. the modeline indicates whether you have modified the file or not.
when editing in hexadecimal, only 0,1,...,9, a,b,...,f, A,B,...F are legal. other keys are unbound. the first time you hit an unbound key, the help pops up. it won't pop again unless you call the help directly (with F1). she learned her lesson.
when editing in ascii, you can find it difficult to enter characters like / which are bound to a function. the solution is to use the quoted insert function Ctrl+Q, the key after the quoted insert function is not processed by hexedit (like emacs' quoted-insert, or like the \ character in C). problem solved bestie π«Ά
π₯ Searching
you can search for a string in ASCII or in hexadecimal. you can switch between the two with Tab. if the string is found, the cursor is moved to the beginning of the matching location. if the search failed, a message "not found" tells you so. you can cancel the search by pressing a key.
the search in hexadecimal is a bit confusing ngl. you must give a hexadecimal string with an even number of characters. the search can then be done byte by byte. if you want to search a long number (eg: a 32 bit number), you must know the internal representation of that number (little/big endian problem) and give it the way it is in memory. for example, on an Intel processor (little endian), you must swap every bytes: 0x12345678 is written 0x78563412 in memory and that's the string you must give to the search engine. π
before searching you are asked if you want to save the changes, if the file is edited.
for more sophisticated search, see Volker Schatz's patch at <http://www.volkerschatz.com/unix/homebrew.html#hexedit>.
πΊ Selecting, copying, pasting, filling
first, select the part of the buffer you want to copy: start setting the mark where you want. then go to the end of the area you want to copy (you can use the go to function and the search functions). then copy it. you can then paste the copied area in the current file or in another file.
you can also fill the selected area with a string or a character: start choosing the block you want to fill in (set mark then move to the end of the block), and call the fill function (F12). hexedit ask you the string you want to fill the block with.
the code is not tuned for huge filling as it keeps the modifications in memory until you save them. that's why hexedit will warn you if you try to fill in a big block. β οΈ
when the mark is set, the selection is shown in reverse mode.
be aware that the copied area contains the modifications done at the time of the copy. but if you undo the modifications, it does not change the content of the copy buffer. it seems obvious but it's worth saying. fr fr.
π§ Scrolling
the scrolling is different whether you are in --sector mode or not. in normal mode, the scrolling is line by line. in sector mode, the scrolling is sector by sector. in both modes, you can force the display to start at a given position using Esc+L. π
π SEE ALSO π
od(1), hdump(1), hexdump(1), bpe(1), hexed(1), beav(1).
π AUTHOR π
Pixel (Pascal Rigaux) <pixel@rigaux.org>, Home page is <http://rigaux.org/>.
π«Ά UNRESTRICTIONS π«Ά
hexedit is Open Source; anyone may redistribute copies of hexedit to anyone under the terms stated in the GNU General Public License.
you can find hexedit at <https://github.com/pixel/hexedit/archive/1.6.tar.gz>
β¨ TODO β¨
Anything you think could be nice...
π LIMITATIONS π
there are problems with the curses library given with Redhat 5.0 that make hexedit think the terminal is huge. the result is that hexedit is not usable. π
the shortcuts work on some machines, and not on others. that's why there are many shortcuts for each function. the Ctrl+Arrows and the Alt+. do not work work as they should most of the time. on SUNs, you must do Ctrl+V-Ctrl+V instead of Ctrl+V (!); and the Alt key is the diamond one. not me finding out the hard way π
while searching, it could be interesting to know which position the search has reached. it's always nice to see something moving to help waiting.
the hexadecimal search could be able to search modulo 4 bits instead of 8 bits. another feature could be to complete padd odd length hexadecimal searches with zeros.
πΈ BUGS πΈ
i have an example where the display is completely screwed up. it seems to be a bug in ncurses (or maybe in xterm and rxvt)?? don't know if it's me using ncurses badly or not... it seems to happen when hexedit leaves only one space at the end of the lines... if anyone has a (or the) solution, please tell me! π₯Ί
if you have any problem with the program (even a small one), please do report it to me. remarks of any kind are also welcome. we love feedback bestie π
okay that's the whole thing, no notes, she ate and left no crumbs π
hexedit, from the General Commands Manual, dated 12 July 1998 β yeah she's an elder icon and she still slays π β¨ bye bestie, go hex-edit something π¦
π¦ where this page comes from
- arch rolling: hexedit 1.6-3 Β· GPL-2.0-or-later
- centos-stream 10: hexedit 1.6-8.el10 Β· GPL-2.0-or-later
- centos-stream 9: hexedit 1.6-1.el9 Β· GPLv2+
- debian bookworm: hexedit 1.6-1 Β· GPL-2.0-or-later
- debian trixie: hexedit 1.6-2 Β· GPL-2.0-or-later
- fedora 43: hexedit 1.6-9.fc43 Β· GPL-2.0-or-later
- fedora 44: hexedit 1.6-10.fc44 Β· GPL-2.0-or-later
- nixos 26.05: hexedit 1.6
- nixpkgs unstable: hexedit 1.6
- opensuse-leap 16.0: hexedit 1.6-bp160.1.13 Β· GPL-2.0-or-later
- opensuse-leap 16.0: hexedit 1.6-bp160.1.13 Β· GPL-2.0-or-later
- opensuse-leap 16.0: hexedit 1.6-bp160.1.13 Β· GPL-2.0-or-later
- opensuse-leap 16.0: hexedit 1.6-bp160.1.13 Β· GPL-2.0-or-later
- ubuntu noble: hexedit 1.6-1 Β· GPL-2.0-or-later
- ubuntu questing: hexedit 1.6-2
- ubuntu resolute: hexedit 1.6-2build1 Β· GPL-2.0-or-later
- ubuntu stonking: hexedit 1.6-2build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms