1HEXEDIT(1)                  General Commands Manual                 HEXEDIT(1)
2
3
4

NAME

6       hexedit - view and edit files in hexadecimal or in ASCII
7

SYNOPSIS

9       hexedit [-s | --sector] [-m | --maximize] [-h | --help] [filename]
10

DESCRIPTION

12       hexedit  shows a file both in ASCII and in hexadecimal. The file can be
13       a device as the file is read a piece at a time. You can modify the file
14       and search through it.
15

OPTIONS

17       -s, --sector
18              Format the display to have entire sectors.
19
20       -m, --maximize
21              Try to maximize the display.
22
23       -h, --help
24              Show the usage.
25

COMMANDS (quickly)

27   Moving
28       <, > :  go to start/end of the file
29       Right:  next character
30       Left:   previous character
31       Down:   next line
32       Up:     previous line
33       Home:   beginning of line
34       End:    end of line
35       PUp:    page forward
36       PDown:  page backward
37
38   Miscellaneous
39       F2:     save
40       F3:     load file
41       F1:     help
42       Ctrl-L: redraw
43       Ctrl-Z: suspend
44       Ctrl-X: save and exit
45       Ctrl-C: exit without saving
46
47       Tab:    toggle hex/ascii
48       Return: go to
49       Backspace: undo previous character
50       Ctrl-U: undo all
51       Ctrl-S: search forward
52       Ctrl-R: search backward
53
54   Cut&Paste
55       Ctrl-Space: set mark
56       Esc-W:  copy
57       Ctrl-Y: paste
58       Esc-Y:  paste into a file
59       Esc-I:  fill
60

COMMANDS (full and detailed)

62       o Right-Arrow, Left-Arrow, Down-Arrow, Up-Arrow - move the cursor.
63       o Ctrl+F, Ctrl+B, Ctrl+N, Ctrl+P - move the cursor.
64       o  Ctrl+Right-Arrow,  Ctrl+Left-Arrow, Ctrl+Down-Arrow, Ctrl+Up-Arrow -
65       move n times the cursor.
66       o Esc+Right-Arrow, Esc+Left-Arrow, Esc+Down-Arrow, Esc+Up-Arrow -  move
67       n times the cursor.
68       o Esc+F, Esc+B, Esc+N, Esc+P - move n times the cursor.
69       o Home, Ctrl+A - go the beginning of the line.
70       o End, Ctrl+E - go to the end of the line.
71       o Page up, Esc+V, F5 - go up in the file by one page.
72       o Page down, Ctrl+V, F6 - go down in the file by one page.
73       o <, Esc+<, Esc+Home - go to the beginning of the file.
74       o >, Esc+>, Esc+End - go to the end of the file (for regular files that
75       have a size).
76       o Ctrl+Z - suspend hexedit.
77       o Ctrl+U, Ctrl+_, Ctrl+/ - undo all (forget the modifications).
78       o Ctrl+Q - read next input character and insert it (this is useful  for
79       inserting control characters and bound keys).
80       o Tab, Ctrl+T - toggle between ASCII and hexadecimal.
81       o  /,  Ctrl+S  - search forward (in ASCII or in hexadecimal, use TAB to
82       change).
83       o Ctrl+R - search backward.
84       o Ctrl+G, F4 - go to a position in the file.
85       o Return - go to a sector in the file if --sector is used, otherwise go
86       to a position in the file.
87       o Esc+L - display the page starting at the current cursor position.
88       o F2, Ctrl+W - save the modifications.
89       o F1, Esc+H - help (show the man page).
90       o Ctrl+O, F3 - open another file
91       o  Ctrl+L - redisplay (refresh) the display (usefull when your terminal
92       screws up).
93       o Backspace, Ctrl+H - undo the modifications made on the previous byte.
94       o Esc+Ctrl+H - undo the modifications made on the previous bytes.
95       o Ctrl+Space, F9 - set mark where cursor is.
96       o Esc+W, Delete, F7 - copy selected region.
97       o Ctrl+Y, Insert, F8 - paste (yank) previously copied region.
98       o Esc+Y, F11 - save previously copied region to a file.
99       o Esc+I, F12 - fill the selection with a string
100       o Esc+T - truncate the file at the current location
101       o Ctrl+C - unconditional quit (without saving).
102       o F10, Ctrl+X - quit.
103
104       For the Esc commands, it sometimes works to use  Alt  instead  of  Esc.
105       Funny things here (especially for froggies :) egrave = Alt+H , ccedilla
106       = Alt+G, Alt+Y = ugrave.
107
108   Modeline
109       At the bottom of the display you have the modeline (copied from emacs).
110       As in emacs, you have the indications --, ** and %% meaning unmodified,
111       modified and read-only. Then you have the name of the file you're  cur‐
112       rently editing. Next to it is the current position of the cursor in the
113       file followed by the total file size. The total file size  isn't  quite
114       correct for devices.
115       While in --sector mode, it shows the sector the cursor is in.
116
117   Editing
118       You can edit in ASCII or in hexadecimal. You can switch between the two
119       with Tab. When the file is read-only, you can't edit it. When trying to
120       edit  a  read-only file, a message (``File is read-only'') tells you it
121       is non-writable.
122       The modifications are shown in bold until they are saved.  The modeline
123       indicates whether you have modified the file or not.
124       When  editing  in  hexadecimal, only 0,1,...,9, a,b,...,f, A,B,...F are
125       legal.  Other keys are unbound. The first time you hit an unbound  key,
126       the help pops up.  It won't pop again unless you call the help directly
127       (with F1).
128       When editing in ascii, you can find it difficult  to  enter  characters
129       like / which are bound to a function. The solution is to use the quoted
130       insert function Ctrl+Q, the key after the quoted insert function is not
131       processed  by hexedit (like emacs' quoted-insert, or like the \ charac‐
132       ter in C).
133
134   Searching
135       You can search for a string in ASCII or in hexadecimal. You can  switch
136       between  the  two with Tab. If the string is found, the cursor is moved
137       to the beginning of the matching location. If the search failed, a mes‐
138       sage  (``not found'') tells you so. You can cancel the search by press‐
139       ing a key.
140       The search in hexadecimal is a bit confusing. You must give a hexadeci‐
141       mal  string  with  an even number of characters. The search can then be
142       done byte by byte. If you want to search a long number (eg:  a  32  bit
143       number), you must know the internal representation of that number (lit‐
144       tle/big endian problem) and give it the way it is in memory. For  exam‐
145       ple,  on an Intel processor (little endian), you must swap every bytes:
146       0x12345678 is written 0x78563412 in memory and that's  the  string  you
147       must give to the search engine.
148       Before  searching you are asked if you want to save the changes, if the
149       file is edited.
150
151       For  more  sophisticated  search,  see   Volker   Schatz's   patch   at
152       <http://www.volkerschatz.com/unix/homebrew.html#hexedit>.
153
154   Selecting, copying, pasting, filling
155       First,  select  the  part of the buffer you want to copy: start setting
156       the mark where you want. Then go to the end of the  area  you  want  to
157       copy  (you  can  use the go to function and the search functions). Then
158       copy it. You can then paste the copied area in the current file  or  in
159       another file.
160
161       You can also fill the selected area with a string or a character: start
162       choosing the block you want to fill in (set mark then move to  the  end
163       of  the  block),  and call the fill function (F12). hexedit ask you the
164       string you want to fill the block with.
165       The code is not tuned for huge filling as it keeps the modifications in
166       memory until you save them. That's why hexedit will warn you if you try
167       to fill in a big block.
168
169       When the mark is set, the selection is shown in reverse mode.
170       Be aware that the copied area contains the modifications  done  at  the
171       time of the copy. But if you undo the modifications, it does not change
172       the content of the copy buffer. It seems obvious but it's worth saying.
173
174   Scrolling
175       The scrolling is different whether you are in --sector mode or not.  In
176       normal  mode,  the  scrolling  is  line  by  line.  In sector mode, the
177       scrolling is sector by sector. In both modes, you can force the display
178       to start at a given position using Esc+L.
179

SEE ALSO

181       od(1), hdump(1), hexdump(1), bpe(1), hexed(1), beav(1).
182

AUTHOR

184       Pixel (Pascal Rigaux) <pixel@rigaux.org>,
185       Home page is <http://rigaux.org/>.
186

UNRESTRICTIONS

188       hexedit  is  Open  Source; anyone may redistribute copies of hexedit to
189       anyone under the terms stated in the GNU General Public License.
190
191       You can find hexedit at
192       <http://rigaux.org/hexedit-1.2.12.src.tgz> and
193       <http://rigaux.org/hexedit-1.2.12.bin.i386.dynamic.tgz>.
194

TODO

196       Anything you think could be nice...
197

LIMITATIONS

199       There are problems with the curses library given with Redhat  5.0  that
200       make  hexedit think the terminal is huge. The result is that hexedit is
201       not usable.
202
203       The shortcuts work on some machines, and  not  on  others.  That's  why
204       there  are  many  shortcuts  for each function. The Ctrl+Arrows and the
205       Alt+. do not work work as they should most of the time.  On  SUNs,  you
206       must  do  Ctrl+V-Ctrl+V  instead  of Ctrl+V (!); and the Alt key is the
207       diamond one.
208
209       While searching, it could be interesting to  know  which  position  the
210       search  has  reached.  It's always nice to see something moving to help
211       waiting.
212
213       The hexadecimal search could be able to search modulo 4 bits instead of
214       8 bits.  Another feature could be to complete padd odd length hexadeci‐
215       mal searches with zeros.
216

BUGS

218       I have an example where the display is completly screwed up.  It  seems
219       to  be  a  bug  in ncurses (or maybe in xterm and rxvt)?? Don't know if
220       it's me using ncurses badly or not... It seems to happen  when  hexedit
221       leaves  only  one  space at the end of the lines... If anyone has a (or
222       the) solution, please tell me!
223
224       If you have any problem with the program (even a small one), please  do
225       report it to me. Remarks of any kind are also welcome.
226
227                                 12 July 1998                       HEXEDIT(1)
Impressum