I have a keyboard without the > and < keys, which sucks when I try to write code. In windows I could alt+numpad + 60/62 to print those keys, but that doesn't work on linux, so I'm trying to make a custom shortcut for it.

According to https://help.ubuntu.com/stable/ubuntu-help/keyboard-shortcuts-set.html:

The command name that you type should be a valid system command. You can check that the command works by opening a Terminal and typing it in there. The command that opens an application cannot have the same name as the application itself.

So I tried echo "<" and print "<", but without success is there another command that prints a key or am I missing something?

2 Answers 2


If I understand correctly you want to bind some keys to < and > system-wide. The easiest way to accomplish that is with xmodmap program.

For example, on my keyboard < and > are shifted , and ., if you like that try to put

keysym comma = comma less
keysym period = period greater

into a file ~.xmodmaprc and run xmodmap ~/.xmodmaprc

If you want to bind them to something else look out for keysym names in the header file /usr/include/X11/keysymdef.h and as usual man xmodmap is your friend.


The xev application can be used for getting the key codes when you press keys.

See also this question: monitoring events (keyboard, mouse) in X

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .