Posted: . At: 11:43 AM. This was 10 years ago. Post ID: 6735
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

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

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: http://www.alanwood.net/demos/ansi.html.

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

homer@lollinux-machina:~$ echo -e "\u00b0"
°

And a punctuation symbol.

homer@lollinux-machina:~$ echo -e "\u00b6"

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

The Control-Shift-U trick is the best way to do this, as long as you know what characters belong to which numbers, it is easy. Just use the same values as the DOS line drawing characters. These will work just fine. This is what it will look like.

┏━(Message from Kali developers)
┃
┃ This is a minimal installation of Kali Linux, you likely
┃ want to install supplementary tools. Learn how:
┃ ⇒ https://www.kali.org/docs/troubleshooting/common-minimum-setup/
┃
┗━(Run: “touch ~/.hushlogin” to hide this message)
┌──(john㉿DESKTOP-PF01IEE)-[~]
└─$ ▉

9 thoughts on “How to type extended ASCII characters on Ubuntu and Linux Mint with the keyboard.”

  1. This does not work for me, not even on the terminal. There must be a simple way of doing this ideally without using hexadecimal, those of us who already learned the decimal code should not have to re-learn it in hexadecimal.

    Reply
    • One of the few things I miss from windows was the character map. Shows every possible character in a font set, you just click and paste. Haven’t found that for Linux yet.

      Reply
      • If you don’t know the Hex code …. Open the Terminal ….Type ‘man ascii’
        Watch tricky display ….. is in Double Column……find the Hex value for the character or symbol you need …… Press to Q to clear the display.
        Then at the prompt in Terminal or in your Document …..While holding down Ctrl + Shift, press and release U (small u)….. Then type the hex code…..THEN release Ctrl and Shift……. your Character will appear in your text
        Ctrl+Shift+U then 00b0 produce … ° symbol
        ‘Ctrl+Shift+U 00e6’ will produce the following ‘æ’.
        Linux Mint Mate Una 20.3 Dell Keyboard
        I hope it helps

        Reply
    • After that, type the corresponding number for your desired char (you can let go of Ctrl+Shift+U for that) and it will suddenly appear. For example, ‘Ctrl+Shift+U 0 0 e 6’ will produce the following ‘æ’.

      Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.