Connecting with telnet looks like this:

$ telnet some.host
Connected to some.host.
Escape character is '^]'.

I'm running this on the OS X Leopard terminal. Question is, how do I send this escape character? On a Linux terminal I'd try ESC-5 or CTRL-5, but I cannot figure out how to do this on OS X.


The ^] means ctrl + right bracket. As strange as that is, it works. You'll be taken to the telnet prompt, where you can type quit.

On international keyboards the ] character is often not a single key, and needs to be replaced with some other key. The correct key is typically the key to the right of P or the next key after that.

Here's a list based on comments below:

  • Finnish, Swedish, Norwegian, Danish: ctrl + å
  • French: ctrl + 6
  • German: ctrl + ü
  • Swiss: ctrl + ¨
  • Hungarian: ctrl + 5
  • Portuguese: ctrl + ´
  • Dutch, Belgian: ctrl + $
  • Canadian French: ctrl + ç
  • Italian: ctrl + +
  • 5
    Ahhh, of course. Except that with my Finnish keyboard layout, it's control + å. Naturally. Thanks :) Jul 15 '09 at 8:53
  • 1
    And on the french keyboard it’s ctrl-6.
    – kmkaplan
    Feb 5 '11 at 18:58
  • 4
    On German Keyboard on OSX it is CTRL-Ü (Umlaut U)
    – user92238
    Jul 29 '11 at 18:54
  • 1
    On a Swiss Keyboard it is Ctrl-¨. Why o why did the telnet developer need to use the group separator GS. So difficult to type on foreign keyboards.
    – Martin
    May 8 '12 at 15:31
  • 5
    on Hungarian (and many more) it is Ctrl+5 May 15 '12 at 10:13

Workaround for those who have problems finding the shortcut:

  1. Change your systems keyboard language to U.S international - PC (System Settings/keyboard/input sources)

  2. Look at an image of a US keyboard layout and ctrl+] the corresponding keys on your keyboard

  • 1
    The accepted answer gives some international examples, but this (especially part 2) is the more generic explanation.
    – Duvrai
    May 6 '20 at 15:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.