Usually I will use xxd
to see what characters I type translate to in hex. For example:
$ xxd
hello
00000000: 0a68 656c 6c6f 0a .hello.
However, how would I do the same for:
- Ctrlz
- Ctrld
- Ctrlc
It seems when I enter either of these three it 'does something' outside the xxd
program, rather than being recognized as a keyboard input for which I want to see the hex codes. So how can I see those values sent by my keyboard for all character combinations?
In the command line console, you can enter codes like Ctrl-Z by first entering Ctrl-V.
So for example, if you type in the following:
Then you should see the following output:
(where, as I'm sure you realise, the
01
corresponds to^A
and0a
is the line break that comes after it)On an ANSI terminal, you can enter escape codes in this way too. For example, type in this:
to print one word in bright red and another in the default colour.