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       --color
24              Display  colors.  This feature is only available if your operat‐
25              ing system supports it.
26
27       -h, --help
28              Show the usage.
29

COMMANDS (quickly)

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

COMMANDS (full and detailed)

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

SEE ALSO

185       od(1), hdump(1), hexdump(1), bpe(1), hexed(1), beav(1).
186

AUTHOR

188       Pixel (Pascal Rigaux) <pixel@rigaux.org>,
189       Home page is <http://rigaux.org/>.
190

UNRESTRICTIONS

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

TODO

200       Anything you think could be nice...
201

LIMITATIONS

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

BUGS

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