How to type extended ASCII characters on Ubuntu and Linux Mint with the keyboard.

Posted: December 15, 2013. At: 11:43 AM. This was 4 years ago. Post ID: 6735

The keyboard in DOS and Windows allows the user to type extended ASCII characters by pressing ALT and typing the number code on the keypad. But this does not work in Linux unless you are using the virtual terminal. So how do you do it in Xorg? Simple. Press CTRL+Shift+U, release the U key and then type the hexadecimal code for the character. To type a ° symbol for example, press CTRL+Shift+U then 00b0 and hit ENTER. There is a listing of ASCII codes on this page that will assist you:

There is also a way to echo unicode characters using echo. Here I am echoing the degree symbol to the shell prompt.

[email protected]:~$ echo -e "\u00b0"

And a punctuation symbol.

[email protected]:~$ echo -e "\u00b6"

This is a very useful technique for inserting various symbols into your text documents and shell prompt.

No comments have been made. Use this form to start the conversation :)

Leave a Reply